Hi, I'm using your software and I would add a simple zoom tool with mouse selection I need to know the exact position of axis origin (left bottom) to transform x,y mouse in chart's coordinates
here my code after sinkEvents(Event.ONMOUSEMOVE|Event.ONMOUSEDOWN| Event.ONMOUSEUP); I tried to calculate the origin public void onBrowserEvent(Event event) { double x; double y; double mouseX=event.getClientX()-getAbsoluteLeft(); double mouseY=getAbsoluteTop()+getOffsetHeight()-event.getClientY(); Axis xAxis = getXAxis(); Axis yAxis = getYAxis(); double dx=xAxis.getAxisLabelThickness() + xAxis.getTickLabelThickness() + xAxis.getTickLength(); double dy=yAxis.getAxisLabelThickness() + yAxis.getTickLabelThickness() + yAxis.getTickLength(); x=mouseX-dx; y=mouseY-dy; // transform in chart coordinates x=xmin+x*(xmax-xmin)/getXChartSize(); y=ymin+y*(ymax-ymin)/getYChartSize(); I'm on the right way or there is a simpler method? thanks Albert ps Excuse me for my english On 22 Set, 23:12, John Gunther <[EMAIL PROTECTED]> wrote: > Client-sideGChartis an open source GWT library that supports bar, > line, and pie charts, and yet adds nothing but its ~2,000 lines of > Java to your application's list of dependencies: > > http://gchart.googlecode.com > > This 2.2 release adds: > > * A new LINE symbol type for faster/better solidly connected line > charts > * A new layout algorithm that centers title, footnotes, axis labels > and legend within explicitly-sizable bands around the plot area. In > particular, since these bands have default thicknesses of 0px when > empty, Sparkline charts are now straightforward. > > For full details, including links to example charts illustrating the > new features, see theGChart2.2 release notes: > > http://gchart.googlecode.com/svn/trunk/doc/com/googlecode/gchart/clie... > > Related posts/acknowledgments: > > 1) This post by Niall Haslam motivated the much-needed switch to a new > chart decoration layout algorithm: > > http://groups.google.com/group/Google-Web-Toolkit/msg/5be9867eb81c9ca4 > > 2) I used the technique explained in this post by Ian Bambury > (http://examples.roughian.com) to workaround a perplexing IE7-only > screen-not-repainting problem that the revisions of this release > inadvertently exposed: > > http://groups.google.com/group/Google-Web-Toolkit/msg/31b2d8e0eace6f3c > > 3) The improved line chart capabilities were motivated by the far-too- > slowly-updating solidly connected line chart code that Malcolm Gorman > sent me. A new live demo chart, deliberately (HTML-element) sized > similarly to Malcolm's chart, illustrates various ways (smaller > charts, lower resolution connecting lines) you can use the new LINE > symbol type to workaround the significant performance limitations that > still remain for this kind of "non-rectangle-friendly" chart. > > Your ideas for improving Client-sideGChartand help in solving its > implementation problems were essential to this 2.2 release. Thank-you. > > John C. Guntherhttp://gchart.googlecode.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---