Javatpoint Logo
Javatpoint Logo

ChartFactory Class

  • ChartFactory class comes under the org.jfree.chart package of JFreeChart library.
  • This class is used to create different types of charts.
  • The ChartFactory class also contains static methods for creating 'ready-made' charts.
  • Each of the methods present in this class are termed after the type of chart it produces, and each of these methods returns an instance of the generic JFreeChart class, regardless of the type of chart involved.

Constructor:

Constructor Description
ChartFactory( ) This is the default constructor of ChartFactory class.

Method Summary:

Method Description
createAreaChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset) This method creates an area chart with default settings.
createBarChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset) This method creates a bar chart with a vertical orientation.
createBubbleChart(String title, String xAxisLabel, String yAxisLabel, XYZDataset dataset) This method creates a bubble chart with default settings.
createCandlestickChart(String title, String timeAxisLabel, String valueAxisLabel, OHLCDataset dataset, boolean legend) This method creates and returns a default instance of a candlesticks chart.
createGanttChart(String title, String categoryAxisLabel, String dateAxisLabel, IntervalCategoryDataset dataset) This method creates a Gantt chart using the supplied attributes plus default values where required.
createHistogram(String title, String xAxisLabel, String yAxisLabel, IntervalXYDataset dataset) This method creates a histogram chart.
createLineChart(String title, String categoryAxisLabel, String valueAxisLabel, CategoryDataset dataset) This method creates a line chart with default settings.
createPieChart(String title, PieDataset dataset) This method creates a pie chart with default settings.
createPieChart3D(String title, PieDataset dataset) This method Creates a 3D pie chart using the specified dataset.
createRingChart(String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls) This method creates a ring chart with default settings.
createScatterPlot(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset) This method creates a scatter plot with default settings.
createTimeSeriesChart(String title, String timeAxisLabel, String valueAxisLabel, XYDataset dataset) This method creates and returns a time series chart.
createXYAreaChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset) This method creates an area chart using a XYDataset.
createXYBarChart(String title, String xAxisLabel, boolean dateAxis, String yAxisLabel, IntervalXYDataset dataset) This method creates and returns a default instance of an XY bar chart.
createXYLineChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset) This method Creates a line chart (based on a XYDataset) with default settings.
createXYStepAreaChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset) This method creates a filled stepped XY plot with default settings.
setChartTheme(ChartTheme theme) This method sets the current chart theme.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA