Javatpoint Logo
Javatpoint Logo

JFreeChart-Pie Chart

A pie chart is a circular graph which is divided into sectors in which the area of each sector represents the size of the data.

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

Pie Chart Demo 1:

JFreeChart Pie Chart Demo 1

Pie Chart Demo 2:

JFreeChart Pie Chart Demo 2

Pie Chart Demo 4:

JFreeChart Pie Chart Demo 4

Pie Chart example

Let us consider a sample data of marks distribution for a class.

Marks Range Number of Students
80-100 120
60-79 80
40-59 20
20-39 7
0-19 3

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

PieChartExample.java

Output:

JFreeChart Pie Chart example




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA