SlideShare a Scribd company logo
1 of 16
JFreeChart
What is JFreeChart?
JfreeChart is an open source library developed in Java, which can be used within
Java based applications to create a wide range of charts.
By using JFreeChart, we can create all the major type of 2D and 3D charts such
as pie chart, bar chart, line chart, XY chart and 3D charts and more.
Why JFreeChart?
It is open source and 100% free, which permits usage in the commercial
applications without any cost.
It supports a wide range of chart types such as Pie Chart, Line Chart, Bar Chart,
Area Chart and 3D charts.
JFreeChart is easy to extend and can be used in both, the client-side, as well as
the server-side applications.
It supports multiple output formats like PNG, JPEG, PDF, SVG etc.
It allows extensive customizations of charts.
In case of Google charts, the application only generates the required URL & get
Class Level Architecture
Detail of the units used in the block diagram
File :The source having user input to be used for creating a dataset in the file.
Database : The source having user input to be used for creating a dataset in
the database.
Create Dataset : Accepts the data and stores the data into dataset object.
General Dataset : This type of dataset is mainly used for pie charts.
Category Dataset : This type of dataset is used for bar chart etc.
Series Dataset : This type of dataset is used for storing series of data and
construct line charts.
Detail of the units used in the block diagram
Series Collection Dataset : The different categories of series datasets are
added to series collection dataset. This type of dataset is used for XYLine
Charts.
Create Chart : This is the method which is executed to create final chart.
Frame/Image : The chart is displayed on a Swing Frame or an image is
created.
Application Level Architecture
Important packages, classes, and
methods from JFreeChart library.
ChartFactory Class
ChartFactory is an abstract class under the org.jfree.chart package. It provides a collection of utility methods for generating standard
charts.
Class Methods
createPieChart(java.lang.String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls)
createPieChart3D(java.lang.String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls)
createBarChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset
dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls)
createBarChart3D(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset
dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls)
createLineChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset
dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls)
ChartUtilities Class
It provides a collection of utility methods of JFreeCharts including methods for converting charts into image file format such as
PNG, JPEG, and creating HTML image maps.
Class Methods
saveChartAsPNG(java.io.File file, JfreeChart chart, int width, int height)
This method converts and saves a chart to the specified file in PNG format.
saveChartAsJPEG(java.io.File file, JfreeChart chart, int width, int height)
This method converts and saves a chart to the specified file in JPEG format.
PiePlot Class
This class provides methods to create Pie Plots.
Class Methods
setStartAngle(double angle)
setSectionPaint(Comparable key, Paint paint)
This method set the specified color to the key..
PlotOrientation Class
This is a serialized class available in org.jfree.chart.plot package and it is used to show the orientation of a 2D plot. The orientation
can either be vertical or horizontal. It sets the orientation of Y-axis.
Field summary
1. PlotOrientation : HORIZONTAL For a plot where the range axis(Y-axis) is horizontal.
2. PlotOrientation : VERTICAL For a plot where the range axis(Y-axis) is vertical. This is the default orientation.
DefaultPieDataset Class
This is a Default implementation class of a PieDataset interface.
Class Method
setValue(java.lang.Comparable key, double value)
It sets the data value for a key and sends a DatasetChangeEvent to all registered listeners.
setValue(java.lang.Comparable key, java.lang.Number value)
It sets the data value for a key and sends a DatasetChangeEvent to all registered listeners.
DefaultCategoryDataset
This is a default implementation class of CategoryDataset interface.
Class Method
addValue(double value, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
This method adds a value to the table using comparable keys.
addValue(java.lang.Number value, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
This method adds a value to the table using comparable keys.
setValue(double value, java.lang.Comparable rowKey, java.lang.Comparable columnKey)
This method adds or updates a value in the table and sends a DatasetChangeEvent to all registered listeners.
Demo
Thanks

More Related Content

What's hot

Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...
Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...
Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...
Databricks
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
Simplilearn
 

What's hot (13)

Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...
Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...
Graph Features in Spark 3.0: Integrating Graph Querying and Algorithms in Spa...
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
SQL - שפת הגדרת הנתונים
SQL - שפת הגדרת הנתוניםSQL - שפת הגדרת הנתונים
SQL - שפת הגדרת הנתונים
 
Aula 04 dicionario de dados
Aula 04   dicionario de dadosAula 04   dicionario de dados
Aula 04 dicionario de dados
 
Data Wrangling and Visualization Using Python
Data Wrangling and Visualization Using PythonData Wrangling and Visualization Using Python
Data Wrangling and Visualization Using Python
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
 
SAS Functions
SAS FunctionsSAS Functions
SAS Functions
 
Mer - Modelo Entidade Relacionamento
Mer - Modelo Entidade RelacionamentoMer - Modelo Entidade Relacionamento
Mer - Modelo Entidade Relacionamento
 
Introduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in RIntroduction to Shiny for building web apps in R
Introduction to Shiny for building web apps in R
 
Data structures
Data structuresData structures
Data structures
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
data structure
data structuredata structure
data structure
 

Viewers also liked

Viewers also liked (17)

Actors model in gpars
Actors model in gparsActors model in gpars
Actors model in gpars
 
Introduction to thymeleaf
Introduction to thymeleafIntroduction to thymeleaf
Introduction to thymeleaf
 
Progressive Web-App (PWA)
Progressive Web-App (PWA)Progressive Web-App (PWA)
Progressive Web-App (PWA)
 
Jmh
JmhJmh
Jmh
 
Grails with swagger
Grails with swaggerGrails with swagger
Grails with swagger
 
Introduction to es6
Introduction to es6Introduction to es6
Introduction to es6
 
Introduction to gradle
Introduction to gradleIntroduction to gradle
Introduction to gradle
 
Hamcrest
HamcrestHamcrest
Hamcrest
 
Apache tika
Apache tikaApache tika
Apache tika
 
Unit test-using-spock in Grails
Unit test-using-spock in GrailsUnit test-using-spock in Grails
Unit test-using-spock in Grails
 
Reactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJavaReactive java - Reactive Programming + RxJava
Reactive java - Reactive Programming + RxJava
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Jsoup
JsoupJsoup
Jsoup
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Cosmos DB Service
Cosmos DB ServiceCosmos DB Service
Cosmos DB Service
 
Spring Web Flow
Spring Web FlowSpring Web Flow
Spring Web Flow
 
Vertx
VertxVertx
Vertx
 

Similar to JFree chart

Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkit
nikhilyagnic
 
Manual to basic gis
Manual to basic gisManual to basic gis
Manual to basic gis
Qust04
 

Similar to JFree chart (20)

JAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdfJAVA PPT -5 BY ADI.pdf
JAVA PPT -5 BY ADI.pdf
 
RS and GIS TW- 1&2.pdf
RS and GIS TW- 1&2.pdfRS and GIS TW- 1&2.pdf
RS and GIS TW- 1&2.pdf
 
Java Graphics
Java GraphicsJava Graphics
Java Graphics
 
Geoprocessing
GeoprocessingGeoprocessing
Geoprocessing
 
newappsonbaseinnovtions
newappsonbaseinnovtionsnewappsonbaseinnovtions
newappsonbaseinnovtions
 
Intake 38 6
Intake 38 6Intake 38 6
Intake 38 6
 
Java Applet
Java AppletJava Applet
Java Applet
 
Creating Dynamic Charts With JFreeChart
Creating Dynamic Charts With JFreeChartCreating Dynamic Charts With JFreeChart
Creating Dynamic Charts With JFreeChart
 
Js info vis_toolkit
Js info vis_toolkitJs info vis_toolkit
Js info vis_toolkit
 
Intake 37 6
Intake 37 6Intake 37 6
Intake 37 6
 
Manual to basic gis
Manual to basic gisManual to basic gis
Manual to basic gis
 
Jfreechart tutorial
Jfreechart tutorialJfreechart tutorial
Jfreechart tutorial
 
Data visualization using R
Data visualization using RData visualization using R
Data visualization using R
 
Ms Visio
Ms VisioMs Visio
Ms Visio
 
Graphics programming in Java
Graphics programming in JavaGraphics programming in Java
Graphics programming in Java
 
Introduction to R Short course Fall 2016
Introduction to R Short course Fall 2016Introduction to R Short course Fall 2016
Introduction to R Short course Fall 2016
 
Layout manager
Layout managerLayout manager
Layout manager
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Ppt chapter03
Ppt chapter03Ppt chapter03
Ppt chapter03
 
Ppt chapter03
Ppt chapter03Ppt chapter03
Ppt chapter03
 

More from NexThoughts Technologies

More from NexThoughts Technologies (20)

Alexa skill
Alexa skillAlexa skill
Alexa skill
 
GraalVM
GraalVMGraalVM
GraalVM
 
Docker & kubernetes
Docker & kubernetesDocker & kubernetes
Docker & kubernetes
 
Apache commons
Apache commonsApache commons
Apache commons
 
HazelCast
HazelCastHazelCast
HazelCast
 
MySQL Pro
MySQL ProMySQL Pro
MySQL Pro
 
Microservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & ReduxMicroservice Architecture using Spring Boot with React & Redux
Microservice Architecture using Spring Boot with React & Redux
 
Swagger
SwaggerSwagger
Swagger
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Arango DB
Arango DBArango DB
Arango DB
 
Jython
JythonJython
Jython
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Smart Contract samples
Smart Contract samplesSmart Contract samples
Smart Contract samples
 
My Doc of geth
My Doc of gethMy Doc of geth
My Doc of geth
 
Geth important commands
Geth important commandsGeth important commands
Geth important commands
 
Ethereum genesis
Ethereum genesisEthereum genesis
Ethereum genesis
 
Ethereum
EthereumEthereum
Ethereum
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
An Introduction to Redux
An Introduction to ReduxAn Introduction to Redux
An Introduction to Redux
 
Google authentication
Google authenticationGoogle authentication
Google authentication
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

JFree chart

  • 2. What is JFreeChart? JfreeChart is an open source library developed in Java, which can be used within Java based applications to create a wide range of charts. By using JFreeChart, we can create all the major type of 2D and 3D charts such as pie chart, bar chart, line chart, XY chart and 3D charts and more.
  • 3. Why JFreeChart? It is open source and 100% free, which permits usage in the commercial applications without any cost. It supports a wide range of chart types such as Pie Chart, Line Chart, Bar Chart, Area Chart and 3D charts. JFreeChart is easy to extend and can be used in both, the client-side, as well as the server-side applications. It supports multiple output formats like PNG, JPEG, PDF, SVG etc. It allows extensive customizations of charts. In case of Google charts, the application only generates the required URL & get
  • 5. Detail of the units used in the block diagram File :The source having user input to be used for creating a dataset in the file. Database : The source having user input to be used for creating a dataset in the database. Create Dataset : Accepts the data and stores the data into dataset object. General Dataset : This type of dataset is mainly used for pie charts. Category Dataset : This type of dataset is used for bar chart etc. Series Dataset : This type of dataset is used for storing series of data and construct line charts.
  • 6. Detail of the units used in the block diagram Series Collection Dataset : The different categories of series datasets are added to series collection dataset. This type of dataset is used for XYLine Charts. Create Chart : This is the method which is executed to create final chart. Frame/Image : The chart is displayed on a Swing Frame or an image is created.
  • 8. Important packages, classes, and methods from JFreeChart library.
  • 9. ChartFactory Class ChartFactory is an abstract class under the org.jfree.chart package. It provides a collection of utility methods for generating standard charts. Class Methods createPieChart(java.lang.String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls) createPieChart3D(java.lang.String title, PieDataset dataset, boolean legend, boolean tooltips, boolean urls) createBarChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) createBarChart3D(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) createLineChart(java.lang.String title, java.lang.String categoryAxisLabel, java.lang.String valueAxisLabel, CategoryDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls)
  • 10. ChartUtilities Class It provides a collection of utility methods of JFreeCharts including methods for converting charts into image file format such as PNG, JPEG, and creating HTML image maps. Class Methods saveChartAsPNG(java.io.File file, JfreeChart chart, int width, int height) This method converts and saves a chart to the specified file in PNG format. saveChartAsJPEG(java.io.File file, JfreeChart chart, int width, int height) This method converts and saves a chart to the specified file in JPEG format.
  • 11. PiePlot Class This class provides methods to create Pie Plots. Class Methods setStartAngle(double angle) setSectionPaint(Comparable key, Paint paint) This method set the specified color to the key..
  • 12. PlotOrientation Class This is a serialized class available in org.jfree.chart.plot package and it is used to show the orientation of a 2D plot. The orientation can either be vertical or horizontal. It sets the orientation of Y-axis. Field summary 1. PlotOrientation : HORIZONTAL For a plot where the range axis(Y-axis) is horizontal. 2. PlotOrientation : VERTICAL For a plot where the range axis(Y-axis) is vertical. This is the default orientation.
  • 13. DefaultPieDataset Class This is a Default implementation class of a PieDataset interface. Class Method setValue(java.lang.Comparable key, double value) It sets the data value for a key and sends a DatasetChangeEvent to all registered listeners. setValue(java.lang.Comparable key, java.lang.Number value) It sets the data value for a key and sends a DatasetChangeEvent to all registered listeners.
  • 14. DefaultCategoryDataset This is a default implementation class of CategoryDataset interface. Class Method addValue(double value, java.lang.Comparable rowKey, java.lang.Comparable columnKey) This method adds a value to the table using comparable keys. addValue(java.lang.Number value, java.lang.Comparable rowKey, java.lang.Comparable columnKey) This method adds a value to the table using comparable keys. setValue(double value, java.lang.Comparable rowKey, java.lang.Comparable columnKey) This method adds or updates a value in the table and sends a DatasetChangeEvent to all registered listeners.
  • 15. Demo