Login Register Wishes Forum About
Language Reference » Charting functions » drawLineChart
Help topics
Latest updates
4693d  replaceImageMapTitle
4693d  replaceImageMapValues
4693d  createFunctionSerie
4693d  setAbsicssaPosition
4693d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
drawLineChart - Draw a line chart

This function allows you to draw a line chart. All the drawing parameters are given trough a $Format array. To learn more about this please read the Format array guide.

Calling this function
Where :

Format is an array containing the drawing parameters of the chart.

Customisation array - Tune up your chart!

It is possible to customize the chart rendering by playing with this array. Providing a detailled configuration is not mandatory.

You can specify if the values must be written on the chart setting DisplayValues to TRUE or FALSE.
You can specify the text UP/RIGHT offset with DisplayOffset.
You can enable image map recording by setting RecordImageMap to TRUE.
You can specify the labels color with DisplayR,DisplayG,DisplayB.

You can define if the labels color will be the same than the serie color of if you want to force it manually setting DisplayColor to :

DISPLAY_MANUAL, color will be specified manually with DisplayR,DisplayG,DisplayB.
DISPLAY_AUTO, will use the serie color.

Handling of missing points

By default, the chart will break everytime a VOID value will be found. If you want to draw a straight line between the missing points then you can set the BreakVoid parameter to FALSE. If you don‘t set a custom color, the serie color will be used. The missing values rendering parameters can be tuned with :

The size of the ticks can be set with VoidTicks.
The line color can be set with BreakR,BreakG,BreakB.

Sample script

 /* Build a dataset */
 $MyData = new pData();  
 $MyData->addPoints(array(-4,VOID,VOID,12,8,3),"Probe 1");
 $MyData->addPoints(array(3,12,15,8,5,-5),"Probe 2");
 $MyData->addPoints(array(2,7,5,18,19,22),"Probe 3");
 $MyData->setSerieTicks("Probe 2",4);
 $MyData->setSerieWeight("Probe 3",2);

 /* Create the 1st chart*/

 /* Create the 2nd chart */

 /* Write the legend*/
Last updated on 12/25/2010 
by Jean-Damien 
Linked resources
Community comments
Message from readybrew on 14/04/2011
Is there a way to rotate the X-axis labels, say at a specific angle?
© 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. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.