Hi...
I know about the JFreeChart class...
But by using that...I'm unable to display the values in the chart.
I'm just getting the points...
I need to get the values also at the specific point in the chart..
can anyone help...
Thanks in advance
May 27, 2010 at 5:59 PM
Hi Friend,
Try the following code:
import java.sql.*;
import java.io.*;
import org.jfree.ui.*;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.*;
import org.jfree.data.jdbc.JDBCCategoryDataset;
public class Chart {
public static void main(String[] args) throws Exception {
String query = "SELECT * from chart";
JDBCCategoryDataset dataset = new JDBCCategoryDataset(
"jdbc:
mysql://localhost:3306/test";,
"com.mysql.jdbc.Driver","root", "root");
dataset.executeQuery(query);
JFreeChart chart =
ChartFactory.createBarChart("Test", "Id", "Marks",
dataset, PlotOrientation.VERTICAL, true, true, false);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
ApplicationFrame f=new ApplicationFrame("Chart");
f.setContentPane(chartPanel);
f.pack();
f.setVisible(true);
try {
ChartUtilities.saveChartAsJPEG(new File("C:/chart.jpg"),
chart,400, 300);
} catch (IOException e) {
System.out.println("Problem in creating chart.");
}
}
}
For the above code, we have created following database table:
CREATE TABLE `chart` (
`id` bigint(40) NOT NULL auto_increment,
`marks` int(40) default NULL,
PRIMARY KEY (`id`)
)
Thanks
Related Tutorials/Questions & Answers:
Graphs in java - Java BeginnersGraphs in java Hi...
I need to generate a graph by using the database values using
java
I know about the JFreeChart class...
But by using that...I'm unable to display the values in the chart.
I'm just getting the points
Good Looking Java Charts and GraphsGood Looking
Java Charts and Graphs Is there a
java chart library that will generate charts and
graphs with the quality of visifire or fusion charts?
The JFreeChart graph quality is not professional looking. Unless it can
Advertisements
Line Graphs in java - Java BeginnersLine
Graphs in java Hi...
I need to generate a graph by using the database values using
java
I know about the JFreeChart class...
But by using that...I'm unable to display the values in the chart.
I'm just getting
Multiline graphs in java - Java BeginnersMultiline
graphs in java How to draw a multiline graph in
java, One will b constant straight line and the other is changing Hi Friend,
Try the following code:
import java.awt.*;
import org.jfree.ui.*;
import
Graphs using JFreeChart - Java BeginnersGraphs using JFreeChart Hi Friend,
I need to draw a graph of the powerconsumed by a consumer in specific dates with a const line showing the max power can be consumed.
Now My data is like this
15-12-2009 150
16-12-2009
Chart & Graphs Tutorials in Java
Chart &
Graphs Tutorials in
Java
... in
Java. Our Chart and
Graphs
tutorials will help learn everything you need to learn about chart and
graphs
programming in
Java. We have provided many examples
ModuleNotFoundError: No module named 'graphs'ModuleNotFoundError: No module named '
graphs' Hi,
My Python... '
graphs'
How to remove the ModuleNotFoundError: No module named '
graphs'... to install padas library.
You can install
graphs python with following command
graphs in jsp - Java3Dgraphs in jsp i want to present my data from database in
graphs how can i present in jsp and servlet.please guide me.thanz in advance
graphs/charts - JSP-Servletgraphs/charts hi,
How to create a graph/chart in
java by reading values from my sql database. Hi Friend,
Try the following code:
import java.sql.* ;
import java.io.* ;
import org.jfree.chart.ChartFactory
Drawing Graphs - Java3DDrawing Graphs how to draw
graphs using certain parameters Hi Friend,
To draw a graph using JfreeChart library, please visit the following link:
http://www.roseindia.net/chartgraphs/index.shtml
Here you
graphs/charts - JSP-Servletgraphs/charts hi frens,
How to create a bar graph by reading values from mysql database. Please help me out... Hi Friend,
We have used jfreechart library to create a bar graph. And the chart displays
gremlin query list all graphsgremlin query list all graphs Hi,
I am trying Gremlin graph query. How to get all the
graphs in one query?
Thanks
Hi,
on the gremlin console run following query:
gremlin> g.V()
This will list all the
graphs Types of Graphs and Charts applications charts and
graphs are extensively
used for visualizing the data.
In
Java... Types of
Graphs and Charts
... the data and call the few methods to generate the charts or
graphs
of your
Drawing Graphs - Swing AWTDrawing Graphs hi i am doing a small project in
java swings . there is a database table having two columns A,B i want to plot a graph to that values in database the graph must be interactive graph
Introduction to Graphs and Charts
Introduction to
Graphs and Charts
Why Charts and
Graphs?
Graphs... difficult and tedious process.ADS_TO_REPLACE_1
All forms of
Graphs and Charts
jgraph to create
graphs for both desktop and server-side
Java applications. Technical...;
Jgraph is open source software for drawing
graphs and structured drawings. Jgraph is written in
Java Programming language. Jgraph was started by Gaudenz Alder
How to create charts in Java?How to create charts in
Java? Is there any example of creating charts and
graphs in
Java?
thanks
Hi,
check the tutorial: Chart &
Graphs Tutorials in
Java
Thanks
JFreeChart TutorialJFreeChart Tutorials, examples and articles
The JFreeChart is
Java based library which is used for generating charts and
graphs in
Java application... for generating dynamic
graphs
from
Java based applications. The JFreeChart
R Tutorial, generation of visual
graphs and scientific research.
In the field of data science... and
graphs formats
R Programming language is popular because:ADS_TO_REPLACE_1...
graphs
R Programming Online Training
Join our online programming training
data structures - Java Beginnersdata structures I have got a project of the subject 'data structures and C++' and the topic is 'types of
graphs'. please guide me on this topic and help me finding material of this topic
how to run org.jfree programss - Java Beginnershow to run org.jfree programss Hi frends,
I was trying to run
java programs to draw
graphs from the link as my frend deepak has given... the above link
java programs........
Thanks Hi Friend,
To run
Open Source Charting and Reporting Tools in Java
Open Source Charting and Reporting Tools in
Java... of them are given
below :
JfreeChart: This is a free
java library for creating different types of charts and
graphs including:
pie charts (2D
GraphGraph What is the code to generate the following
graphs?
1.Simple Bar diagram
2.Sub-divided Bar diagram
3.Pie chart
Please Help!!!!
Please visit the following link:
Java charts and
graphs Java I/O Object Streams is used to write the primitive data types and
graphs of
Java
objects...
Java I/O Object Streams
In this section we will discuss the
Java IO Object Streams.
To work with the I/O of objects
Java provided the support of Object
combobox updation - Java Beginnerscombobox updation hi,
i am using
java swing to develop a gui-there are 4 components in the gui: menus,3 comboboxes,buttons and
graphs... for more information.
http://www.roseindia.net/
java/example/
java/swing
Value Stack / OGNLValue Stack / OGNL
Object Graph Navigational Language (OGNL) is a open source framework used to get properties from
Java Beans. In Struts 2 framework, OGNL... to handle requests.ADS_TO_REPLACE_1
OGNL uses dot notation to navigate object
graphs Doubt Regarding ChartsDoubt Regarding Charts Hi,
Can you please help me out by answering "hoe to include charts in core
java code and struts code"
thanks in advance... charts and
graphs Including applet in JSF (XHTML)Including applet in JSF (XHTML) Hi
I want to generate
graphs in facelets project. We are using JSF 2.0. We have Perspective for
Java to generate
graphs. in this project. So, Perspective for
Java is providing an applet which i
Generate RDF file in Java of "Jena". Jena is a
java API to create and
manipulate RDF
graphs...
Generate RDF file in
Java
In this example we are going to generate our first RDF
Java store objects in FileJava store objects in File
In this section, you will learn how to use the ObjectOutputStream and
ObjectInputStream to write and read serialized object... for
graphs of objects when used with a FileOutputStream and
FileInputStream
Java ObjectOutputStream the primitive data types
and the
graphs of
Java objects to the output stream. It writes...
Java ObjectOutputStream
In this tutorial we will discuss about the
Java class... the object to the output stream. In this
example at first I have created a
Java Java I/O Data Streams is used to write the primitive data types and
graphs of
Java objects...
Java I/O Data Streams
In this tutorial we will discuss the
Java I/O Data... as the
String values
Java provided the support of Data stream. DataInput
JPA 2.1 Tutorial of Entity
Graphs
Using Second-Level Cache with
Java Persistence API... of JPA 2.1
The
Java Persistence API Version 2.1 or simply JPA 2.1 is part of JEE... for using
the data from relational database in
Java based applications. The JPA allows
Bar Chart for same year with parameters) similarly i want bar for 2006 which again has 9
graphs............
java swing code
Plotting equations on a cartesian Plane of
java, and i at the moment of working on a program that takes the input...;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class
Graphs...();
JComboBox Topics = new JComboBox();
public
Graphs javajava diff bt core
java and
java