how to read 1 value from a series
I have a chart, it shows 2 series as bars and a trend line as a spline. it works well.
The first item in my trend line series is the series average, followed by some 0.12345 values (to draw a break line) then the trend data. I wanted to add a label showing the average for the trend line to my chart, but the getSeriesAverage function counted the 0.12345 values and returned an incorrect value.
As I have the average value in my data table I decided to try and read it from there.
Code:
$MyData = new pData();
$MyData->importFromCSV("http://xxxxxx/efficiency.csv",array("GotHeader"=>TRUE));
$avg=$MyData->Data['Series']['Trend']['Data'][0];
The important thing above is that Trend is the header value from the data file, the other names are standard values from the pData class.
If there is a better way to do this please let me know, otherwise I hope this helps someone
edited text for clarification