3D column (1)

xiaoxiao2021-03-14  209

import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.CategoryLabelPositions; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.renderer.category.BarRenderer; import org.jfree.chart.renderer.category.CategoryItemRenderer; import org. jfree.data.category.CategoryDataset; import org.jfree.data.category.DefaultCategoryDataset; import org.jfree.ui.ApplicationFrame; import org.jfree.ui.RefineryUtilities; / ** * This demonstration shows a 3D bar chart with item .. labels displayed * * / public class BarChart3DDemo3 extends applicationFrame {/ ** * Creates a new demo * * @param title the frame title * / public BarChart3DDemo3 (final String title) {super (title);. final CategoryDataset dataset = createDataset (); Final Jfreechart Chart = Createchart (Dataset); Final ChartPanel Chartpan EL = New ChartPanel (Chart); ChartPanel.SetPreferredSize (NEW JAVA.AWT.DIMENSION (500, 270)); SetContentPane (ChartPanel);

} // ***************************************************************** *************************************** / / * JFreechart Developer Guide * // * The Jfreechart Developer Guide, Written By David Gilbert, IS Available * // * to Purchase from Object Refinery Limited: * // * * // * http://www.object-refinery.com/jfreechart/guide.html * // * * // * Sales Are Used to Provide Funding for the jfreechart project - please * // * Support us so this we can continue. * // ******************************** *********************************************************** * / ** * Creates a sample dataset. * * @Return a sample DataSet. * / Private categoryDataSet createDataSet () {Final defaultcategoryDataSet Dat ASET = New DefaultcategoryDataSet (); Dataset.addValue (25.0, "Series 1", "Category 1"); Dataset.AddValue (34.0, "Series 1", "Category 2"); Dataset.addValue (19.0, "Series 2 "," Category 1 "); Dataset.addValue (29.0," Series 2 "," Category 2 "); Dataset.AddValue (41.0," Series 3 "," Category 1 "); Dataset.addValue (33.0," Series 3 "," category 2 "); return dataset;} / ** * creates a chart. * @Param DataSet the dataset. * * @

转载请注明原文地址:https://www.9cbs.com/read-129361.html

New Post(0)