Setting the legend box layout

Depending on the number of series displayed, a horizontal legend box might advance the boundaries of the chart area, hidding series titles. In such case, it is necessary to reduce the number of columns displayed, stacking series titles one above the other. JetChart applets provide parameters to configure the legend box column layout and the gaps between rows and columns.

Six line series are displayed below. The legend layout is configured to display 3 columns, rather than leaving the titles disposed side by side, in which case the legend box would be partially hidden. The last three series titles were split into two lines, by inserting the '\n' character in the proper place.



<applet code="GraphApplet.class" codebase="../../demo/applets/classes" archive="GraphChart.jar" width=450 height=350>

<param name="legendcollayout" value="3">

<param name="3d" value="yes">
<param name="labels" value="l1,l2,l3,l4,l5,l6,l7,l8,l9,l10">
<param name="title" value="The JetChart Library,Setting the legend box layout">
<param name="serie1" value="line,Line Series 1,ff0000">
<param name="serie1_values" value="3543,3000,2890,2991,3000,2500,2300,1900,2200,1800">
<param name="serie2" value="line,Line series 2,0000ff">
<param name="serie2_values" value="3543,3000,2890,2991,3000,2500,2300,1900,2200,1800">
<param name="serie3" value="line,Line series 3,00ff00">
<param name="serie3_values" value="3543,3000,2890,2991,3000,2500,2300,1900,2200,1800">
<param name="serie4" value="line,Line series 4,ffff00">
<param name="serie4_values" value="3543,3000,2890,2991,3000,2500,2300,1900,2200,1800">
<param name="serie5" value="line,Line\nseries 5,ff00ff">
<param name="serie5_values" value="3543,3000,2890,2991,3000,2500,2300,1900,2200,1800">
<param name="serie6" value="line,Line\nseries 6,00ffff">
<param name="serie6_values" value="3543,3000,2890,2991,3000,2500,2300,1900,2200,1800">
</applet>