Is there anyone willing to share with the forum on
how to implement a line chart and a pie chart with MySQL ?
JFreeChart Eg with MySQL ?
Re: JFreeChart Eg with MySQL ?
You can use the JdbcPieDataset and JdbcCategoryDataset classes to read tables directly into datasets, or write your own code to query the database and feed data into a dataset class.
I've written up examples in the JFreeChart Developer Guide using PostgreSQL, but thanks to JDBC the same code should work against most databases as long as you have the correct JDBC driver...
Regards,
Dave Gilbert
I've written up examples in the JFreeChart Developer Guide using PostgreSQL, but thanks to JDBC the same code should work against most databases as long as you have the correct JDBC driver...
Regards,
Dave Gilbert
Re: JFreeChart Eg with MySQL ?
Dave
Thanks for your response.
But it would be great if you could provide examples on
how to use your
JdbcPieDataset and JdbcCategoryDataset.
I would luv to purchase your 200 page JFreeChart Developer Guide or
JFreeChart Documentation, but $ is tight for me now.
Thanks for your response.
But it would be great if you could provide examples on
how to use your
JdbcPieDataset and JdbcCategoryDataset.
I would luv to purchase your 200 page JFreeChart Developer Guide or
JFreeChart Documentation, but $ is tight for me now.
Re: JFreeChart Eg with MySQL ?
Dave
Hope u didnt take that personally.
Sorry if u did.
Thanks
Hope u didnt take that personally.
Sorry if u did.
Thanks
Re: JFreeChart Eg with MySQL ?
After executing executeQuery, should one recreate JdbcCategoryDataset to assign the resultSet in executeQuery ?
Does one need to convert between datasets from jdbcCategoryDataset
to another dataset, say piedataset in order to draw a pie chart ?
Does one need to convert between datasets from jdbcCategoryDataset
to another dataset, say piedataset in order to draw a pie chart ?
Re: JFreeChart Eg with MySQL ?
From my reading of the code (I didn't write it), it looks as though the query runs once and what you are left with is a DefaultCategoryDataset.
There are methods in the DatasetUtilities class to copy data from any CategoryDataset into a new PieDataset.
You can also create a "multi" pie chart using the CategoryDataset directly.
I did some editing of the JDBCCategoryDataset and JDBCPieDataset classes to simplify them slightly for the 0.9.5 release, also to reflect some changes that I've made to the interfaces.
Regards,
Dave Gilbert
There are methods in the DatasetUtilities class to copy data from any CategoryDataset into a new PieDataset.
You can also create a "multi" pie chart using the CategoryDataset directly.
I did some editing of the JDBCCategoryDataset and JDBCPieDataset classes to simplify them slightly for the 0.9.5 release, also to reflect some changes that I've made to the interfaces.
Regards,
Dave Gilbert