Chart Colors


Applet code: <applet code=com.objectplanet.chart.ChartApplet  archive=chart.jar width=450 height=300> <param name=chart value=bar> <param name="sampleValues" value="6.55, 5.97, 4.72, 3.76, 3.45, 3.24, 2.97, 2.52, 1.82, 1.62, 1.09, 0.61"> <param name="sampleLabels" value="Scotland, Austria, Japan, Korea, Israel, Sweden, Germany, Norway, Poland, Spain, Island, Turkey"> <param name="barLabelsOn" value="true"> <param name="barLabelFont" value="Arial,bold,11"> <param name="range" value="7"> <param name="lowerRange" value="0"> <param name="rangeLabelFont" value="Arial,bold,12"> <param name="sampleColors" value="#5294A5"> <param name="sampleLabelColors" value="#FFC200"> <param name="barAlignment" value="horizontal"> <param name="barWidth" value="0.5"> <param name="barOutlineOff" value="true"> <param name="3DModeOn" value="true"> <param name="chartBackground" value="black"> <param name="chartForeground" value="#FFC200"> <param name="foreground" value="#FFC200"> <param name="background" value="black"> </applet>
Servlet code: <img src="http://server_name/servlet/com.objectplanet.chart.ChartServlet? chart=pie& width=450& height=300& sampleValues=6.55,5.97,4.72,3.76,3.45,3.24,2.97,2.52,1.82,1.62,1.09,0.61& sampleLabels=Scotland,Austria,Japan,Korea,Israel,Sweden,Germany,Norway,Poland,Spain,Island,Turkey& barLabelsOn=true& barLabelFont=Arial,bold,11& range=7& lowerRange=0& rangeLabelFont=Arial,bold,12& sampleColors=%235294A5& sampleLabelColors=%23FFC200& barAlignment=horizontal& barWidth=0.5& barOutlineOff=true& 3DModeOn=true& chartBackground=black& chartForeground=%23FFC200& foreground=%23FFC200& background=black">
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[] {6.55, 5.97, 4.72, 3.76, 3.45, 3.24, 2.97, 2.52, 1.82, 1.62, 1.09, 0.61}; String[] sampleLabels = new String[] {"Scotland"," Austria"," Japan"," Korea"," Israel"," Sweden"," Germany"," Norway"," Poland"," Spain"," Island"," Turkey"}; BarChart chart = new BarChart(); chart.setSampleCount(sampleValues.length); chart.setSampleValues(0, sampleValues); chart.setSampleColor(0, new Color(0x5294A5)); chart.setSampleLabels(sampleLabels); chart.setSampleLabelsOn(true); chart.setSampleLabelStyle(Chart.BELOW); chart.setFont("sampleLabelFont", new Font("Arial", Font.BOLD, 11)); chart.setRelativeRange(0, 1, 1); chart.setFont("rangeLabelFont", new Font("Arial", Font.BOLD, 12)); chart.setBarOutlineOn(false); chart.setBarAlignment(chart.HORIZONTAL); chart.set3DModeOn(true); chart.setChartForeground(new Color(0xFFC200)); chart.setForeground(new Color(0xFFC200)); chart.setChartBackground(Color.black); chart.setBackground(Color.black); 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(); } }