Javatpoint Logo
Javatpoint Logo

JFreeChart-Bar Chart

A bar chart is a chart that represents the grouped data with rectangles. The height or length of the bar is propositional to the value that represents the bar.

The following images show some of the demo versions of bar chart incorporated in JFreeChart library:

Bar Chart Demo 1:

JFreeChart Bar Chart Demo 1

Bar Chart Demo 2:

JFreeChart Bar Chart Demo 2

Bar Chart Demo 3:

JFreeChart Bar Chart Demo 3

Bar Chart Demo 4:

JFreeChart Bar Chart Demo 4

Bar Chart example

Let us consider a sample input data for our bar chart example.

Year Population in Million
USA INDIA CHINA
2005 10 15 20
2010 15 20 25
2015 20 25 30

The following codes create a bar chart from the above sample data:

BarChartExample.java

Output:

JFreeChart bar Chart example




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA