View unanswered posts | View active topics It is currently Thu May 09, 2024 6:58 pm



Reply to topic  [ 1 post ] 
how to read 1 value from a series 
Author Message
pChart user
pChart user

Joined: Fri Mar 11, 2011 10:40 am
Posts: 6
Post 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


Thu Mar 31, 2011 11:04 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron