Menu

How to define ClickEventHandler on Rangeselection button

XiGuan
2012-03-02
2012-07-13
  • XiGuan

    XiGuan - 2012-03-02

    Hi
    So far I am using below code in below link to customize different Range Selector Button. It's working great. Thanks for your work.
    https://sourceforge.net/p/gwt-highcharts/discussion/general/thread/6950cbd3/

    private class Button extends Configurable<Button> {  }
    StockChart chart = new StockChart();    
    chart.setRangeSelector(new RangeSelector()
                            .setOption("buttons", new Button[] {
                                         new Button().setOption("type", "year")
                                                     .setOption("count", 1)})    
                          );
    

    Now,except changing the range span of the chart, I need add more business logic when using click one range button, which means I have to catch this click event and handle it.

    I have checked the JAVA API. Seems it just has click event handler for the plot part.

    So does anyone know how to define Click handler Handler on that RangeSelector button ?

     
  • Shawn Quinn

    Shawn Quinn - 2012-03-26

    FYI - For those that need this event, support for this has now been formally included in the the GWT Highcharts 1.3.0 release (thanks to Jeff Myers!). Here's an example of the new event handler:

     chart.getXAxis().setAxisSetExtremesEventHandler(new AxisSetExtremesEventHandler() {
           public boolean onSetExtremes(AxisSetExtremesEvent event) {
              Window.alert("Extremes changed: " + event.getMin() + " - " + event.getMax());
              return true;
           }
        )
     });
    
     

Log in to post a comment.