📄 polarchartdemo1.java
字号:
// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov Date: 7/18/2005 5:13:55 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
package org.jfree.chart.demo;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JPanel;
import org.jfree.chart.*;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.PolarPlot;
import org.jfree.data.xy.*;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RefineryUtilities;
public class PolarChartDemo1 extends ApplicationFrame
{
public PolarChartDemo1(String s)
{
super(s);
XYDataset xydataset = createDataset();
JFreeChart jfreechart = createChart(xydataset);
ChartPanel chartpanel = new ChartPanel(jfreechart);
chartpanel.setPreferredSize(new Dimension(500, 270));
setContentPane(chartpanel);
}
private static XYDataset createDataset()
{
XYSeriesCollection xyseriescollection = new XYSeriesCollection();
XYSeries xyseries = new XYSeries("Series 1");
xyseries.add(0.0D, 2D);
xyseries.add(90D, 13D);
xyseries.add(180D, 9D);
xyseries.add(270D, 8D);
xyseriescollection.addSeries(xyseries);
XYSeries xyseries1 = new XYSeries("Series 2");
xyseries1.add(90D, -11.199999999999999D);
xyseries1.add(180D, 21.399999999999999D);
xyseries1.add(250D, 17.300000000000001D);
xyseries1.add(355D, 10.9D);
xyseriescollection.addSeries(xyseries1);
return xyseriescollection;
}
private static JFreeChart createChart(XYDataset xydataset)
{
JFreeChart jfreechart = ChartFactory.createPolarChart("Polar Chart Demo 1", xydataset, true, false, false);
jfreechart.setBackgroundPaint(Color.white);
PolarPlot polarplot = (PolarPlot)jfreechart.getPlot();
polarplot.setBackgroundPaint(Color.lightGray);
NumberAxis numberaxis = (NumberAxis)polarplot.getAxis();
numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
return jfreechart;
}
public static JPanel createDemoPanel()
{
JFreeChart jfreechart = createChart(createDataset());
return new ChartPanel(jfreechart);
}
public static void main(String args[])
{
PolarChartDemo1 polarchartdemo1 = new PolarChartDemo1("Polar Chart Demo");
polarchartdemo1.pack();
RefineryUtilities.centerFrameOnScreen(polarchartdemo1);
polarchartdemo1.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -