Grid Image
Applet code:
<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=300 height=200>
<param name=chart value=bar>
<param name=sampleValues value="5,10,15,20,25,30">
<param name=sampleColors value=#F1F8FF>
<param name=range value="50">
<param name=gridImage value="images/op.gif">
<param name=background value=#F1F8FF>
</applet>
Servlet code:
<img src="http://server_name/servlet/com.objectplanet.chart.ChartServlet?
chart=pie&
width=450&
height=300&
sampleValues=5,10,15,20,25,30&
sampleColors=%23F1F8FF&
range=50&
gridImage=http://server_name/op.gif&
background=%23F1F8FF
">
Application code:
package com.objectplanet.chart.testing;
import com.objectplanet.chart.*;
import java.awt.*;
public class Bar {
public static void main(String[] argv) {
double[] sampleValues = new double[] {5,10,15,20,25,30};
BarChart chart = new BarChart();
chart.setSampleCount(6);
chart.setSampleValues(0, sampleValues);
chart.setSampleColor(0, new Color(0xF1F8FF));
chart.setRange(0, 50);
chart.setBackground(new Color(0xF1F8FF));
Image image = chart.loadImage("images\\op.gif");
chart.addImage("gridImage", image);
chart.setGridImage("gridImage");
com.objectplanet.chart.NonFlickerPanel p = new com.objectplanet.chart.NonFlickerPanel(new BorderLayout());
p.add("Center", chart);
Frame f = new Frame();
f.add("Center", p);
f.setSize(300,220);
f.show();
}
}
|