Contents
Login Register Wishes Forum About
Language Reference » Dataset functions » addPoints
Help topics
Latest updates
2145d  replaceImageMapTitle
2145d  replaceImageMapValues
2145d  createFunctionSerie
2145d  setAbsicssaPosition
2145d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
addPoints - Build your data series

This function allow you to populate your data series by either providing single points or an array of points. You can manage multiple data series in a single pData object.

Missing points can be replaced by the VOID keyword.

If you add points to a serie that isn‘t existing yet, it will be binded to the axis #0, to bind it to another axis, use the setSerieOnAxis function. You can create an unlimited number of axis in pChart 2.0.

Calling this function
addPoints($Values,$SerieName="Serie1");
Where :

Value is either one value or an array of values.
SerieName is the name of the serie were you want to add the point(s).

If SerieName isn‘t provided, the points will be added to Serie1.

Sample script

 /* Add a single point to Serie1 */
 $myData->addPoints(7);

 /* Add an array of points to Serie2 */
 $myData->addPoints(array(2,3,4,VOID,5),"Serie2");

This will create two data series, 1st one will take the default name of Serie1 and will contains only one data point. The second one explicitely called Serie2 will contains 5 points including a missing value represented by the VOID keyword.
Last updated on 11/27/2009 
by Jean-Damien 
Linked resources
Community comments
Message from readybrew on 22/03/2011
How does addPoints() behave if you specify a Serie name which was not added using addSerie() ?
Message from Jean-Damien on 29/03/2011
It will create a new serie. (This is the easiest way to create a data serie)
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 409 users have registered. This page has been rendered in 0,02 seconds. Wiki revision 1.37.