JCCKit logo

4. JCCKit's PlotApplet

The class PlotApplet is an out-of-the-box applet to visualize static data on an HTML page. The layout is governed by applet parameters. The data are either specified by applet parameters or loaded from a .properties file from the Web server.

All static examples on the page Examples use this applet. Here is a minimum example:

The corresponding HTML code reads:
<applet code="jcckit.PlotApplet" codebase="../examples" archive="jcckit.jar" width="400" height="200">
<param name="data/curves" value="curve">
<param name="data/curve/x" value="0 0.5 1">
<param name="data/curve/y" value="0.3 0.9 0.5">
The default axes and layout has been used. Only one curve with three points has been defined.

The scaling of axis box and curves adapts automatically to the size of the applet panel as shown in the following two variants of the same example where only the width and height attributes of the applet tag have been changed:

width=300 height=150 width=150 height=150
But the font size does not scale! The default value is zero which will be translated to a fixed size by the GraphicsRenderer.

For an appropriated font size which scales nicely the following param tags have been added:

<param name="plot/coordinateSystem/xAxis/axisLabelAttributes/fontSize" value="0.03">
<param name="plot/coordinateSystem/xAxis/ticLabelAttributes/fontSize" value="0.03">
<param name="plot/coordinateSystem/yAxis/axisLabelAttributes/fontSize" value="0.03">
<param name="plot/coordinateSystem/yAxis/ticLabelAttributes/fontSize" value="0.03">
<param name="plot/legend/titleAttributes/fontSize" value="0.02">

These font sizes are in device-independent coordinates.