java - How to know the values of every DataSet on JfreeChart Mouseover or Mouse Click envent -
i want know how can know values of curve(dataset) when standing on over xyplot.
i've implement code kwnoing values of scale on axis:
int mousex = event.gettrigger().getx(); int mousey = event.gettrigger().gety(); point mousepoint = new point(mousex, mousey); // convert java2d coordinate axis coordinates... chartrenderinginfo chartinfo = chart.getchartrenderinginfo(); point2d java2dpoint = chart.translatescreentojava2d(mousepoint); plotrenderinginfo plotinfo = chartinfo.getplotinfo(); rectangle2d panelarea = chart.getscreendataarea(mousex, mousey); double yy = math.round(plot.getrangeaxis().java2dtovalue( mousepoint.gety(), panelarea, plot.getrangeaxisedge())); stringbuffer stringb = new stringbuffer(); stringb.append("profundidad : " + yy); // x coordinate same subplots rectangle2d dataarea = plotinfo.getdataarea(); list<long> curvas = pista.getcurvas(); (int = 0, j = curvas.size(); < j; i++) { if (curvas.get(i) != null) { double puntoxx = plot.getdomainaxis(i) .java2dtovalue(java2dpoint.getx(), dataarea, plot.getdomainaxisedge(i)); double xx = (math.ceil((puntoxx + 0.05d) * 100)) / 100; mdcurva curva = buscadoreslista.buscarenlistacurvas(curvas .get(i)); stringb.append(" " + curva.getnombrecurva() + " " + xx); } } pbarraestado.getinstance().gettextosubestado2().settext( stringb.tostring());
but, want know value of every curva in plot. can anywone me that
i'd start examples found under miscellaneous > crosshairs
in jfreechart demo
.
Comments
Post a Comment