Broken and Connected Lines
Applet code:
<applet code=com.objectplanet.chart.ChartApplet
archive=chart.jar width=450 height=300>
<param name=chart value="line">
<param name=seriesCount value=3>
<param name=sampleColors value="#7F6E30,#AD4284,#194D8E">
<param name=sampleValues_0 value="65,43,54,65,76,87,69,87,98,90,98,90,80,98,79,87,98,79,87,60">
<param name=sampleValues_1 value="55,x,x,x,x,x,x,x,x,x,x,,77,x,x,x,x,x,x,x,60">
<param name=sampleValues_2 value="85,91,75,x,x,x,54,47,48,50,58,43,x,x,x,47,58,49,57,52,55">
<param name=range value=100>
<param name=lowerRange value=40>
<param name=rangeLabelFont value="Arial,bold,13">
<param name=maxValueLineCount value=10>
<param name=connectedLinesOn value="1">
<param name=lineWidth value="3,3,4">
<param name=chartBackground value=#efefef>
<param name=background value=white>
</applet>
Servlet code:
<img src="http://localhost:8080/servlet/com.objectplanet.chart.ChartServlet?
chart=pie&
width=450&
height=300&
seriesCount=3&
sampleColors=%237F6E30,%23AD4284,%23194D8E&
sampleValues_0=65,43,54,65,76,87,69,87,98,90,98,90,80,98,79,87,98,79,87,60&
sampleValues_1=55,x,x,x,x,x,x,x,x,x,x,,77,x,x,x,x,x,x,x,60&
sampleValues_2=85,91,75,x,x,x,54,47,48,50,58,43,x,x,x,47,58,49,57,52,55&
range=100&
lowerRange=40&
rangeLabelFont=Arial,bold,13&
maxValueLineCount=10&
connectedLinesOn=1&
lineWidth=3,3,4&
chartBackground=%23efefef&
background=white">
Application code:
package com.objectplanet.chart.testing;
import com.objectplanet.chart.*;
import java.awt.*;
public class Line {
public static void main(String[] argv) {
double[] sampleValues_0 = new double[] {65,43,54,65,76,87,69,87,98,90,98,90,80,98,79,87,98,79,87,60};
double[] sampleValues_1 = new double[] {55,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,77,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,Double.NaN,60};
double[] sampleValues_2 = new double[] {85,91,75,Double.NaN,Double.NaN,Double.NaN,54,47,48,50,58,43,Double.NaN,Double.NaN,Double.NaN,47,58,49,57,52,55};
Color[] sampleColors = new Color[] {new Color(0x7F6E30), new Color(0xAD4284), new Color(0x194D8E)};
LineChart chart = new LineChart();
chart.setSeriesCount(3);
chart.setSampleCount(sampleValues_0.length);
chart.setSampleValues(0, sampleValues_0);
chart.setSampleValues(1, sampleValues_1);
chart.setSampleValues(2, sampleValues_2);
chart.setSampleColors(sampleColors);
chart.setLowerRange(0,40);
chart.setFont("rangeLabelFont", new Font("Arial", Font.BOLD, 13));
chart.setMaxValueLineCount(10);
chart.setConnectedLinesOn(1, true);
chart.setLineWidth(-1, 3);
chart.setChartBackground(new Color(0xefefef));
chart.setBackground(Color.white);
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(450,320);
f.show();
}
}
|