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 Chart3DcreateAreaChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns an area chart based on the supplied dataset.static Chart3DcreateBarChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a bar chart based on the supplied dataset.static Chart3DcreateLineChart(String title, String subtitle, CategoryDataset3D dataset, String rowAxisLabel, String columnAxisLabel, String valueAxisLabel) Creates and returns a line chart based on the supplied dataset.static Chart3DcreatePieChart(String title, String subtitle, PieDataset3D<? extends Comparable> dataset) Creates and returns a pie chart based on the supplied dataset.static Chart3DcreateScatterChart(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 Chart3DcreateStackedBarChart(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 Chart3DcreateSurfaceChart(String title, String subtitle, Function3D function, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates a surface chart for the specified function.static Chart3DcreateXYZBarChart(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 Chart3DcreateXYZLineChart(String title, String subtitle, XYZDataset dataset, String xAxisLabel, String yAxisLabel, String zAxisLabel) Creates and returns a line chart based on the supplied dataset.static ChartStyleReturns a new instance of the default chart style (so that, by default, all charts will have an independent style instance).static voidsetDefaultChartStyle(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 (nullnot 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 aPiePlot3Dinstance (so it is safe to cast the result ofchart.getPlot()).
For reference, here is a sample pie chart:- Parameters:
title- the chart title (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot 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 aCategoryPlot3Dusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).rowAxisLabel- the row axis label (nullpermitted).columnAxisLabel- the column axis label (nullpermitted).valueAxisLabel- the value axis label (nullpermitted).- 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 aCategoryPlot3Dusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).rowAxisLabel- the row axis label (nullpermitted).columnAxisLabel- the column axis label (nullpermitted).valueAxisLabel- the value axis label (nullpermitted).- 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 aCategoryPlot3Dusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).rowAxisLabel- the row axis label (nullpermitted).columnAxisLabel- the column axis label (nullpermitted).valueAxisLabel- the value axis label (nullpermitted).- 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 aCategoryPlot3Dusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).rowAxisLabel- the row axis label (nullpermitted).columnAxisLabel- the column axis label (nullpermitted).valueAxisLabel- the value axis label (nullpermitted).- 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 anXYZPlotusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).xAxisLabel- the x-axis label (nullpermitted).yAxisLabel- the y-axis label (nullpermitted).zAxisLabel- the z-axis label (nullpermitted).- 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).function- the function (nullnot permitted).xAxisLabel- the x-axis label (nullpermitted).yAxisLabel- the y-axis label (nullpermitted).zAxisLabel- the z-axis label (nullpermitted).- 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 anXYZPlotusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).xAxisLabel- the x-axis label (nullpermitted).yAxisLabel- the y-axis label (nullpermitted).zAxisLabel- the z-axis label (nullpermitted).- 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 anXYZPlotusing 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 (nullpermitted).subtitle- the chart subtitle (nullpermitted).dataset- the dataset (nullnot permitted).xAxisLabel- the x-axis label (nullpermitted).yAxisLabel- the y-axis label (nullpermitted).zAxisLabel- the z-axis label (nullpermitted).- Returns:
- The chart.
- Since:
- 1.5
-