Hello,
This is my first post.
I'm working in a program (java Language) to manage a football championship.
In particular at the relative part of graph (JFreeChart with XYSplineRenderer graph), to calculate the points in a league, match by match
In the image in attachment we have a graph of three teams.
http://img853.imageshack.us/img853/7066/imgfo.png
http://imageshack.us/photo/my-images/853/imgfo.png/
I need to see some information when the mouse is over the intersection points, I don't know an Annotation or a ToolTip,
in short some object to see these information.
Obviously these information are already stored and ready to be used.
Thank you very much for your support,
Goodbye
Graph:Mouse over interest point
Re: Graph:Mouse over interest point
Try to search this forum for TooltipGenerator and see what you can do.
- martin
- martin
Re: Graph:Mouse over interest point
ah thank you,
I know find me too, without write in the forum.
I want to know if you have some additional informations.
Thanks
I know find me too, without write in the forum.
I want to know if you have some additional informations.
Thanks
Re: Graph:Mouse over interest point
Finally.............
after a billion of tests I solve my problem.
Post my solution for other users.
First need create XYPlot and XYLineAndShapeRenderer (or XYSplineRenderer)
then create ItemGenerator class (or other name), it implements XYToolTipGenerator
Thanks to admin, with a little example I would have solved my problem quickly.
Bye.
after a billion of tests I solve my problem.
Post my solution for other users.
First need create XYPlot and XYLineAndShapeRenderer (or XYSplineRenderer)
Code: Select all
XYLineAndShapeRenderer xylineandshaperenderer = new XYLineAndShapeRenderer();
.....
xylineandshaperenderer.setBaseToolTipGenerator((XYToolTipGenerator)new ItemGenerator());
Code: Select all
import org.jfree.chart.labels.XYToolTipGenerator;
import org.jfree.data.xy.XYDataset;
public class ItemGenerator implements XYToolTipGenerator {
public ItemGenerator(){
}
@Override
public String generateToolTip(XYDataset dataset, int series, int category) {
String giornata_sq = null;
String punti_sq = null;
//Number value = dataset.getValue(series, category);
Number value = (int)dataset.getXValue(series, category);
Number value1 = (int)dataset.getYValue(series, category);
if (value != null && value1!=null) {
giornata_sq = value.toString();
punti_sq = value1.toString();
}
return giornata_sq+"° giornata, " + punti_sq+" punti";
}
}
Bye.