Displaying x axis labels and the grid
Labels are displayed along the x axis of charts created with GraphApplet, giving a
description to each of the series data points.
The grid is made up of lines crossing the graph area, each line starting at a scale tick. The
grid lines bring a better perception of data points positioning against respective scales.
The grid is only available to graphs displayed by GraphApplet and ScatterApplet.
The previous example was modified to display labels and the grid lines.
Automatic label spacing is provided by default, preventing labels from overlapping each other.
The third and fifth labels are split into two lines, inserting a '\n' character at the appropriate
position. Labels can bet vertically oriented, setting the parameter 'verticallabelson' to 'yes'. Line
splitting is only possible if labels are horizontally displayed.
The grid lines are solid by default, but they can also be displayed as dashed lines.
This example also gives an introduction to graphsets, to which one topic of this tutorial is dedicated.
<applet code="GraphApplet.class" codebase="../../demo/applets/classes" archive="GraphChart.jar" width=400 height=300>
<param name="labels" value="label1,label2,Third\nlabel,label4,Fifth\nlabel,label6,label7">
<param name="labelsfont" value="SansSerif,12,2">
<param name="graphset0_gridon" value="yes">
<param name="graphset0_gridcolor" value="999999">
<param name="graphset0_crossedgridon" value="yes">
<param name="graphset0_crossedgridcolor" value="999999">
<param name="title" value="The JetChart Library,Displaying x axis labels and the grid">
<param name="titlefont" value="SansSerif,12,1">
<param name="lefttitle" value="Left Title">
<param name="lefttitlefont" value="Dialog,12,0">
<param name="righttitle" value="Right Title">
<param name="righttitlefont" value="Dialog,12,0">
<param name="bottomtitle" value="Bottom Title">
<param name="bottomtitlefont" value="Dialog,12,0">
<param name="serie1" value="line,Line Series,ff0000">
<param name="serie1_values" value="100,80,90,40,75,60,85">
<param name="serie2" value="bar,Bar Series,0000ff">
<param name="serie2_values" value="50,70,80,30,60,55,75">
<param name="serie3" value="stackbar,Stacked bar 1,ffff00">
<param name="serie3_values" value="36,45,30,25,40,15,30">
<param name="serie4" value="stackbar,Stacked bar 2,00ff00">
<param name="serie4_values" value="36,45,30,25,40,15,30">
</applet>
To display vertical labels, do as follows:
<param name="verticallabelson" value="yes">
Line splitting is not available if labels are vertically displayed.
To display dashed horizontal grid lines:
<param name="graphset0_gridstyle" value="1">
To display dashed vertical grid lines:
<param name="graphset0_crossedgridstyle" value="1">