Simple Bar Chart
Applet code: <applet code=com.objectplanet.chart.ChartApplet archive=chart.jar width=300 height=200> <param name=chart value="bar"> <param name=sampleValues value="10,20,40,65,50"> <param name=sampleColors value="#FF7310"> <param name=range value=70> <param name=background value="white"> </applet> Servlet code: <img src="http://server_name:8080/servlet/com.objectplanet.chart.ChartServlet? width=330& height=220& chart=bar& sampleValues=10,20,40,65,50& sampleColors=%23FF7310& range=70& background=white "> 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[] {10,20,40,65,50}; Color[] c = new Color[] {new Color(0xFF7310)}; BarChart chart = new BarChart(); chart.setSampleCount(5); chart.setSampleValues(0, values); chart.setSampleColors(c); chart.setBackground(Color.white); chart.setRange(0, 70); Frame f = new Frame(); f.setSize(450,320); f.add("Center", chart); f.show(); } } |