Added JSNI method to show reset zoom button after zooming via API

This commit is contained in:
Benjamin Barth committed 2016-07-18 09:17:28 +02:00
1 parent fead633e77
commit 702cafd1cd
1 file changed
+8 -1
@@ -226,8 +226,15 @@ public abstract class AbstractRaceChart<SettingsType extends Settings> extends A
public void onTimeZoomChanged(Date zoomStartTimepoint, Date zoomEndTimepoint) {
changeMinMaxAndExtremesInterval(zoomStartTimepoint, zoomEndTimepoint, true);
// Probably there is a function for this in a newer version of highcharts: http://jsfiddle.net/mqz3N/1071/
// chart.showResetZoom();
this.showResetZoom();
}
// Because there is no method within highcharts Java API, the respective JS method is called via JSNI.
private native void showResetZoom() /*-{
var chartObject = this.@com.sap.sailing.gwt.ui.client.shared.charts.AbstractRaceChart::chart;
var chart = chartObject.@org.moxieapps.gwt.highcharts.client.Chart::getNativeChart()();
if (chart) chart.showResetZoom();
}-*/;
@Override
public void onTimeRangeChanged(Date fromTime, Date toTime) {