Chart Ranges
Applet code:
<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=450 height=300>
<param name=chart value=bar>
<param name=sampleValues_0 value=5,15,23,-34,-45,56,28,17,-16,-30>
<param name=barWidth value=0.3>
<param name=sampleColors value=red>
<param name=background value=#F8F7B8>
<param name=chartBackground value=#FFFFD6>
<param name=range value=-60>
<param name=lowerRange value=60>
<param name=rangeColor value=#A20202>
<param name=rangeLabelFont value=Arial,plain,10>
<param name=rangeAdjusterOn value=true>
<param name=rangeAdjusterPosition value=right>
<param name=rangeLabelPostfix value=#>
<param name=rangeDecimalCount value=1>
<param name=valueLabelsOn value="true">
</applet>
Servlet code:
<img SRC="http://127.0.0.1:8080/servlet/com.objectplanet.chart.ChartServlet?
width=450&
height=300 &
chart=bar&
sampleValues_0=5,15,23,-34,-45,56,28,17,-16,-30&
barWidth=0.3&
sampleColors=red&
background=%23F8F7B8&
chartBackground=%23FFFFD6&
range=-60&
lowerRange=60&
rangeColor=%23A20202&
rangeLabelFont=Arial,plain,10&
rangeAdjusterPosition=right&
rangeLabelPostfix=%23&
rangeDecimalCount=1&
valueLabelsOn=true&">
Application code:
package com.objectplanet.chart.testing;
import com.objectplanet.chart.*;
import java.awt.*;
public class Bar {
public static void main(String[] argv) {
double[] values = new double[] {5,15,23,-34,-45,56,28,17,-16,-30};
Color[] sampleColor = new Color[] {Color.red};
Color[] rangeColor = new Color[] {new Color(0xA20202)};
BarChart chart = new BarChart();
chart.setSampleCount(10);
chart.setSampleValues(0, values);
chart.setSampleColors(sampleColor);
chart.setBackground(new Color(0xF8F7B8));
chart.setChartBackground(new Color(0xFFFFD6));
chart.setBarWidth(0.3);
chart.setRange(0, -60);
chart.setLowerRange(0, 60);
chart.setRangeColor(0, new Color(0xA20202));
chart.setLabel("rangeLabelPostfix", "#");
chart.setFont("rangeLabelFont_0", new Font("Arial", Font.PLAIN, 10));
chart.setRangeAdjusterOn(0, true);
chart.setRangeDecimalCount(0, 1);
chart.setValueLabelsOn(true);
Frame f = new Frame();
f.setSize(450,320);
f.add("Center", chart);
  f.show();
}
}
Applet code:
<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=450 height=300>
<param name=chart value=bar>
<param name=sampleValues_0 value=5,15,23,-34,-45,56,28,17,-16,-30>
<param name=barWidth value=0.3>
<param name=sampleColors value=red>
<param name=background value=#F8F7B8>
<param name=chartBackground value=#FFFFD6>
<param name=range value=-60>
<param name=lowerRange value=60>
<param name=rangeColor value=#A20202>
<param name=rangeLabelFont value=Arial,plain,10>
<param name=rangeAdjusterOn value=true>
<param name=rangeAdjusterPosition value=right>
<param name=rangeLabelPostfix value=#>
<param name=rangeDecimalCount value=1>
<param name=valueLabelsOn value="true">
</applet>
Servlet code:
<img SRC="http://127.0.0.1:8080/servlet/com.objectplanet.chart.ChartServlet?
width=450&
height=300 &
chart=bar&
sampleValues_0=5,15,23,-34,-45,56,28,17,-16,-30&
barWidth=0.3&
sampleColors=red&
background=%23F8F7B8&
chartBackground=%23FFFFD6&
range=-60&
lowerRange=60&
rangeColor=%23A20202&
rangeLabelFont=Arial,plain,10&
rangeAdjusterPosition=right&
rangeLabelPostfix=%23&
rangeDecimalCount=1&
valueLabelsOn=true&">
Application code:
package com.objectplanet.chart.testing;
import com.objectplanet.chart.*;
import java.awt.*;
public class Bar {
public static void main(String[] argv) {
double[] values = new double[] {5,15,23,-34,-45,56,28,17,-16,-30};
Color[] sampleColor = new Color[] {Color.red};
Color[] rangeColor = new Color[] {new Color(0xA20202)};
BarChart chart = new BarChart();
chart.setSampleCount(10);
chart.setSampleValues(0, values);
chart.setSampleColors(sampleColor);
chart.setBackground(new Color(0xF8F7B8));
chart.setChartBackground(new Color(0xFFFFD6));
chart.setBarWidth(0.3);
chart.setRange(0, -60);
chart.setLowerRange(0, 60);
chart.setRangeColor(0, new Color(0xA20202));
chart.setLabel("rangeLabelPostfix", "#");
chart.setFont("rangeLabelFont_0", new Font("Arial", Font.PLAIN, 10));
chart.setRangeAdjusterOn(0, true);
chart.setRangeDecimalCount(0, 1);
chart.setValueLabelsOn(true);
Frame f = new Frame();
f.setSize(450,320);
f.add("Center", chart);
  f.show();
}
}