Re: not sure how....hundreds of time values
This is my first day with pChart.
I'm just starting to do this and have a basic chart working. I collect some performance information every 10 mins. So you will have a lot more data if you collect every 1 to 3 seconds. If you collect data every second you will have 86,400 points every day. I would image if you try to chart that you will wait a long time for the chart to draw and you will not see all of the points. If your chart is 1000 pixels wide then 86,400 points has to fit into that space. That's not going to happen in a way that you will see what you intend to see.
You may want to consider either keeping a running average that averages all the points in a 1 min time period or even do a stock chart and display high, low, mean, 25 and 75 percentile for every hour. then you can drill in to any hour you want and display all of the points in that hour. But remember even in an hour there are 3600 seconds so you would have to have a very big monitor.
In terms of the x axis display
You can set pChart to display x axis labels only when they change. So I'm displaying the last 24 hours of day and only want to see hour markers.
This is the relevant code
Code:
$MyData->addPoints($xValueArray,"Labels");
$MyData->setAbscissa("Labels");
$MyData->setXAxisDisplay(AXIS_FORMAT_TIME,"m/d\n H"); // this is the key when the value that is output by this format changes then it will be displayed as the next xaxis tick mark.
...
// don't quote LABELING_DIFFERENT because it is a constant and not a string
$scaleSettings = array(
"LabelingMethod"=> LABELING_DIFFERENT, "XMargin"=>10,"YMargin"=>10,
"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,
"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE);
$myPicture->drawScale($scaleSettings);
For auto refresh you can write some header information that sets the meta refresh tag
http://en.wikipedia.org/wiki/Meta_refresh to do this in php
http://us.php.net/manual/en/function.header.php There is an example in that pages that shows how. But this means you will have to query your database each time you do this.
I hope this helps.
Eric