×
Menu
Index

LineChart

 
 
  • LineChart( init line, init col, height, width, data, data titles, chart title, colors, nMin, nMax, nSteps ) => draws a line chart, at position init line, init col with size height, width, using the values in data array, for each position, a title in data titles is displayed. Multiple lines can be drawn, each one will have its color from the colors array. A title can be displayed at the top/center of the chart using the chart title parameter. See a sample at Charts.PDF
 
 
Init line (numeric) :  
Vertical position of chart corner according to coordinate system.
 
Init col (numeric) :
 
Horizontal position of corner to start drawing the chart.
Height (numeric) :
 
Height of box containing the chart.
Width (numeric ) :    
       
Width of box containing the chart.
Data (array) :
 
An array of arrays. Each sub array contains data values to be charted, one line will be drawn for each element of the sub array, using different colors  for each line, automatic scaling will be calculated according to lowest/highest value present in all the array.
 
Data titles (array) :
An array containing titles for each sub array in the data array, those titles will be displayed at the bottom of the chart.
 
Chart title (character) :
 
Title of the chart, will be displayed on the center of the chart top row.
Colors (array) :  
 
An array of colors for the lines of the chart, should have as many elements as sub arrays in the data array. Conforms to color definition in GRA.CH or any valid RGB color.
 
nMin :             
              
The minimum value for the vertical axis. Default is the minimum value in the data.
nMax :
The maximum value for the vertical axis. Default is the maximum value in the data.
 
nSteps :
 
The quantity of steps of the scale in the vertical axis of the chart. Default is 10
 
Example : oPdf:LineChart( 44, 10, 14, 50, data, titu, "Line Chart Sample",  { GRA_CLR_BLUE, GRA_CLR_RED } )
                                      this will draw a line chart with blue and red lines. See Demo.PDF for more details.