How to extend ChartSelectionEvent

I need to use the following code to get clientX and clientY once users select some area on Vaadin chart:

	chart.addChartSelectionListener(new ChartSelectionListener() {

        public void onSelection(ChartSelectionEvent event) {
				double x = event.getClientX();                //There is no such method in current implementation.

How do I extend ChartSelectionEvent? Doesn’t It work once I extend it?



Firstly, you need to capture this info in the client-side GWT ChartSelectionEvent (meaning com.vaadin.addon.charts.client.ui.ChartSelectionEvent, not com.vaadin.addon.charts.ChartSelectionEvent). Then you need to update the onSelectionRpc() method in the ChartServerRpc interface to allow passing the information to the server side. To match that change, you need to change the onStateChanged method in ChartConnector. Finally, you need to update the ChartServerRpcImplementation in (to get the info from the RPC) and update the server-side ChartSelectionEvent to host the new info.

You’ll need to rebuild the widgetset (and the Charts project) for the client-side changes to take effect, mind you.


Thank to [everyone]
( on this [thread]
( had this question and needed [solution]