Can't create multiple series, what am I missing?
I've spent the afternoon playing with pChart which so far is working, except for the fact that I'm unable to create multiple series. I have temperature from two probes as well as timestamps associated with each reading.
I can graph one series without issue, but when I add the second series it appears to just append the data from the second series onto the end of the first series. Also, using color coding or weight formatting seems to affect all the points, not just the series I tell it to.
Below is the code I'm using. $allReadings[] is an array containing more arrays that represent each dataset. I have verifed that the two datasets have equal amounts of entries. I've spent the last two hours searching for clues on google and going over the examples trying to find what I'm doing wrong, but I can't find it. Can someone point me in the right direction here?
Code:
# echo "generating graph";
$myData = new pData();
$myData->addPoints($allTimestamps[0], "Timestamp");
$myData->addPoints($allReadings[0], "Probe 1");
$myData->addPoints($allReadings[1], "Probe 2");
$myData->setSerieWeight("Probe 2", 2);
$myData->setAbscissa("Timestamp");
$myData->setXAxisName("Time");
$myData->setXAxisDisplay(AXIS_FORMAT_TIME,"H:i");
$myData->setAxisName(0,"Temperature");
$myData->setAxisUnit(0," F");
$myData->loadPalette("/var/www/palettes/navy.color", TRUE);
$myPicture = new pImage(1400,500,$myData);
$myPicture->setFontProperties(array("FontName"=>"/var/www/fonts/Forgotte.ttf","FontSize"=>12));
$myPicture->setGraphArea(60,40,1380,480);
$myPicture->drawScale(array("LabelSkip"=>59, "CycleBackground"=>TRUE));
$myPicture->drawSplineChart();
$myPicture->Render("/var/www/graph.png");
Thanks,
ljb2of3