/********************************************************************** # Copyright (c) EWA Systems Inc. 1998 - 2005 All Rights Reserved # No part of this program may be photocopied, reproduced, # or translated to another programming language without # the prior written consent of EWA Systems. **********************************************************************/ package com.ewasystems.chart.test; import java.awt.Color; import com.ewasystems.chart.AxesPolar; import com.ewasystems.chart.Chart; import com.ewasystems.chart.ChartData; import com.ewasystems.chart.JFrameChart; /** *
Title: Sample Polar Chart
*Copyright: (c) 1998 - 2005
*Company: EWA Systems, Inc.
* @author Lincoln Evans-Beauchamp * @version 1.0 */ public class SamplePolar extends JFrameChart { public SamplePolar() { Chart chart = getChart(); AxesPolar axes = new AxesPolar(chart); double r[] = new double[20]; double theta[] = new double[r.length]; for (int k = 0; k < r.length; k++) { theta[k] = Math.PI*k/(r.length-1); r[k] = 0.5 + Math.cos(theta[k]); } ChartData data = new ChartData(axes, r, theta); data.setDataType(ChartData.DATA_TYPE_MARKER | ChartData.DATA_TYPE_LINE); data.setLineColor(Color.green); data.setMarkerColor(Color.blue); } public static void main(String argv[]) { new SamplePolar().setVisible(true); } public String toString() {return "Sample Polar";} }