0

I want to pass a cell refernce to my dataset of JFreeChart. How can I pass a cell of excel for chart using JFreeChart?

For example,

DefaultCategoryDataset my_bar_chart_dataset = new DefaultCategoryDataset();

my_bar_chart_dataset.addValue("Here i want to pass cell reference","Customer","");

I am using library and for chart.

For example, we have in excel like i want to drag a cell and create chart like that i have to pass cell reference so that if i can mouse over graph part then that will show me cell which i have selected.

click here like what i want attach in image. i have to pass cell reference in jfreechart as i mention in question.

Vimal
  • 73
  • 1
  • 12
  • Once you have the data, follow [`org.jfree.chart.demo.BarChartDemo1`](http://www.jfree.org/jfreechart/api/javadoc/src-html/org/jfree/chart/demo/BarChartDemo1.html). – trashgod Feb 14 '17 at 00:56
  • @GreyBeardedGeek this question is not duplicate of any question as you mention what i want is diffrent.i have to pass a cell reference in jfreechart addvalue method – Vimal Feb 14 '17 at 13:24
  • @trashgod please explain how would i pass a cell reference. DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(7445, "JFreeSVG", "Warm-up"); dataset.addValue(24448, "Batik", "Warm-up"); dataset.addValue(4297, "JFreeSVG", "Test"); dataset.addValue(21022, "Batik", "Test"); return dataset; – Vimal Feb 14 '17 at 13:25
  • @trashgod as per your code i have trided but it will pass value not cellreference – Vimal Feb 14 '17 at 14:10
  • You'll have to loop though the referenced cells and add the _values_ to the dataset. Then, edit your question to include a [mcve] that focuses on any remaining problem. – trashgod Feb 16 '17 at 16:30
  • @trashgod that i have already done by loop but i want to pass a cell reference not value. – Vimal Feb 17 '17 at 12:12
  • `DefaultCategoryDataset` has no method with that signature; you'll have to create one. If this is not a duplicate, please edit your question to include a [mcve] that shows your revised approach. – trashgod Feb 17 '17 at 16:49
  • @trashgod how can i create method for pass a cell reference. can you give me please some tips for that. and how to edit question to include a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) don't understand what exactly you talking about i am new to stackoverflow – Vimal Feb 22 '17 at 07:17
  • The [mcve] link explains it. – trashgod Feb 22 '17 at 07:33

0 Answers0