Home Forums StockChart Support Range Select Buttons not highlighted if rangeChanging option used

Range Select Buttons not highlighted if rangeChanging option used

Viewing 3 posts - 1 through 3 (of 3 total)
  • #40255

    I have a function that fires every time the range of the chart is changed using the range buttons. If I use this function, the selected range button is not highlighted…

    Sample code can be found in below fiddle:
    https://jsfiddle.net/k93y6v70/1/

    #41379

    @avb,

    We are looking into your query and will get back to you at the earliest.

    —-
    Manoj Mohan
    Team CanvasJS

    #41682

    @avb,

    There seems to be an issue when navigator is disabled due to which selected range button is not highlighted after rendering the chart. You can workaround this issue by hiding the navigator using css and also setting selectedRangeButtonIndex in the rangeChanging event handler. Please take a look at this below code snippet.

    
    <style>
    #stockChartContainer .canvasjs-navigator-panel {
      display: none !important;
    }
    </style>
    
    rangeChanged: function(e) {
    .
    .
    if(e.source == "buttons") {
      stockChart.rangeSelector.set("selectedRangeButtonIndex", e.index, false);
    }
    .
    .
    }
    

    Please take a look at this updated JSFiddle for complete working code.

    —-
    Manoj Mohan
    Team CanvasJS

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.