本文整理匯總了Java中org.jfree.chart.ChartFactory.createStackedBarChart3D方法的典型用法代碼示例。如果您正苦於以下問題:Java ChartFactory.createStackedBarChart3D方法的具體用法?Java ChartFactory.createStackedBarChart3D怎麽用?Java ChartFactory.createStackedBarChart3D使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.chart.ChartFactory
的用法示例。
在下文中一共展示了ChartFactory.createStackedBarChart3D方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createChart
import org.jfree.chart.ChartFactory; //導入方法依賴的package包/類
/**
* Create a stacked bar chart with sample data in the range -3 to +3.
*
* @return The chart.
*/
private static JFreeChart createChart() {
// create a dataset...
Number[][] data = new Integer[][]
{{new Integer(-3), new Integer(-2)},
{new Integer(-1), new Integer(1)},
{new Integer(2), new Integer(3)}};
CategoryDataset dataset = DatasetUtilities.createCategoryDataset("S",
"C", data);
// create the chart...
return ChartFactory.createStackedBarChart3D(
"Stacked Bar Chart 3D", // chart title
"Domain", "Range",
dataset, // data
PlotOrientation.HORIZONTAL,
true, // include legend
true,
true
);
}
示例2: addChart
import org.jfree.chart.ChartFactory; //導入方法依賴的package包/類
/**
* It creates a chart for the given dataset and adds the chart to the panel.
*
* @param dataset The dataset that will provide the values for the chart.
*/
private void addChart() {
JFreeChart chart = ChartFactory.createStackedBarChart3D(
getTitle(), null, "Breakdown" + unitSuffix(),
dataset, PlotOrientation.VERTICAL, true, true, false);
CategoryAxis domainAxis = chart.getCategoryPlot().getDomainAxis();
domainAxis.setCategoryLabelPositions(
CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
chart.addProgressListener(locker);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
renderer.setToolTipGenerator(dataset);
mainPanel().add(BorderLayout.CENTER, new ChartPanel(chart));
}