java.lang.Object
org.jfree.chart3d.Chart3DFactory
Utility methods for constructing common chart types. Charts can be
assembled piece-wise, but usually it is simpler to use the methods in this
class then customise the resulting chart as necessary.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Chart3D
createAreaChart
(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns an area chart based on the supplied dataset.static Chart3D
createBarChart
(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a bar chart based on the supplied dataset.static Chart3D
createLineChart
(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a line chart based on the supplied dataset.static Chart3D
createPieChart
(String title, String subtitle, PieDataset3D<? extends Comparable> dataset) Creates and returns a pie chart based on the supplied dataset.static Chart3D
createScatterChart
(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a scatter plot based on the supplied dataset (containing one or more series of(x, y, z)
values).static Chart3D
createStackedBarChart
(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a stacked bar chart based on the supplied dataset.static Chart3D
createSurfaceChart
(String title, String subtitle, Function3D function, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates a surface chart for the specified function.static Chart3D
createXYZBarChart
(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a bar chart based on the supplied dataset (this is for special cases, most general cases will be covered by thecreateBarChart(String, String, CategoryDataset3D, String, String, String)
method).static Chart3D
createXYZLineChart
(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a line chart based on the supplied dataset.static ChartStyle
Returns a new instance of the default chart style (so that, by default, all charts will have an independent style instance).static void
setDefaultChartStyle
(ChartStyle style) Sets the style that will be used when creating new charts.
-
Method Details
-
getDefaultChartStyle
Returns a new instance of the default chart style (so that, by default, all charts will have an independent style instance).- Returns:
- The default chart style (never
null
). - Since:
- 1.2
-
setDefaultChartStyle
Sets the style that will be used when creating new charts.- Parameters:
style
- the style (null
not permitted).- Since:
- 1.2
-
createPieChart
public static Chart3D createPieChart(String title, String subtitle, PieDataset3D<? extends Comparable> dataset) Creates and returns a pie chart based on the supplied dataset. The chart returned by this method will be constructed using aPiePlot3D
instance (so it is safe to cast the result ofchart.getPlot()
).
For reference, here is a sample pie chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).- Returns:
- A pie chart (never
null
).
-
createBarChart
public static Chart3D createBarChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a bar chart based on the supplied dataset. The chart returned by this method will be constructed with aCategoryPlot3D
using aBarRenderer3D
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).
For reference, here is a sample bar chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).rowAxisLabel
- the row axis label (null
permitted).columnAxisLabel
- the column axis label (null
permitted).valueAxisLabel
- the value axis label (null
permitted).- Returns:
- A bar chart (never
null
).
-
createStackedBarChart
public static Chart3D createStackedBarChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a stacked bar chart based on the supplied dataset. The chart returned by this method will be constructed with aCategoryPlot3D
using aStackedBarRenderer3D
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).
For reference, here is a sample stacked bar chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).rowAxisLabel
- the row axis label (null
permitted).columnAxisLabel
- the column axis label (null
permitted).valueAxisLabel
- the value axis label (null
permitted).- Returns:
- A stacked bar chart (never
null
).
-
createAreaChart
public static Chart3D createAreaChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns an area chart based on the supplied dataset. The chart returned by this method will be constructed with aCategoryPlot3D
using anAreaRenderer3D
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).
For reference, here is a sample area chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).rowAxisLabel
- the row axis label (null
permitted).columnAxisLabel
- the column axis label (null
permitted).valueAxisLabel
- the value axis label (null
permitted).- Returns:
- An area chart (never
null
).
-
createLineChart
public static Chart3D createLineChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a line chart based on the supplied dataset. The chart returned by this method will be constructed with aCategoryPlot3D
using aLineRenderer3D
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).
For reference, here is a sample line chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).rowAxisLabel
- the row axis label (null
permitted).columnAxisLabel
- the column axis label (null
permitted).valueAxisLabel
- the value axis label (null
permitted).- Returns:
- A line chart (never
null
).
-
createScatterChart
public static Chart3D createScatterChart(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a scatter plot based on the supplied dataset (containing one or more series of(x, y, z)
values). The chart returned by this method will be constructed with anXYZPlot
using aScatterXYZRenderer
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).
For reference, here is a sample scatter chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).xAxisLabel
- the x-axis label (null
permitted).yAxisLabel
- the y-axis label (null
permitted).zAxisLabel
- the z-axis label (null
permitted).- Returns:
- The chart.
-
createSurfaceChart
public static Chart3D createSurfaceChart(String title, String subtitle, Function3D function, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates a surface chart for the specified function.
For reference, here is a sample surface chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).function
- the function (null
not permitted).xAxisLabel
- the x-axis label (null
permitted).yAxisLabel
- the y-axis label (null
permitted).zAxisLabel
- the z-axis label (null
permitted).- Returns:
- The chart.
- Since:
- 1.1
-
createXYZBarChart
public static Chart3D createXYZBarChart(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a bar chart based on the supplied dataset (this is for special cases, most general cases will be covered by thecreateBarChart(String, String, CategoryDataset3D, String, String, String)
method). The chart returned by this method will be constructed with anXYZPlot
using aBarXYZRenderer
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).
For reference, here is a sample XYZ bar chart:- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).xAxisLabel
- the x-axis label (null
permitted).yAxisLabel
- the y-axis label (null
permitted).zAxisLabel
- the z-axis label (null
permitted).- Returns:
- The chart.
-
createXYZLineChart
public static Chart3D createXYZLineChart(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a line chart based on the supplied dataset. The chart returned by this method will be constructed with anXYZPlot
using aLineXYZRenderer
(so it is safe to cast the plot and/or renderer to customise attributes that are specific to those subclasses).- Parameters:
title
- the chart title (null
permitted).subtitle
- the chart subtitle (null
permitted).dataset
- the dataset (null
not permitted).xAxisLabel
- the x-axis label (null
permitted).yAxisLabel
- the y-axis label (null
permitted).zAxisLabel
- the z-axis label (null
permitted).- Returns:
- The chart.
- Since:
- 1.5
-