jfreechart

package com.epro.jfreechart.example;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.general.DatasetUtilities;

public class DatasetUtilitiesExample {
public static void main(String[] args) {
double[][] data = new double[][] { { 672, 766, 223, 540, 126 },
{ 325, 521, 210, 340, 106 }, { 332, 256, 523, 240, 526 } };
String[] rowKeys = { "pingguo", "lizhi", "putao" };
String[] columnKeys = { "baijing", "shanghai", "guangzhou", "chengdu",
"shenzheng" };

CategoryDataset dataset = DatasetUtilities.createCategoryDataset(
rowKeys, columnKeys, data);

JFreeChart chart = ChartFactory.createBarChart3D(
"shui guo chang liang tu", "shui guo", "chang liang", dataset,
PlotOrientation.VERTICAL, true, true, false);

ChartFrame frame = new ChartFrame("zhu zhuang tu 3d xiao guo", chart);

frame.pack();
frame.setVisible(true);
}
}

你可能感兴趣的:(jfreechart)