Home Forums Chart Support How to All range button set as selected in rangeChanged event

How to All range button set as selected in rangeChanged event

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

    Hi,

    I am facing issue when I am trying to update new data in rangeChanged event. Actually what I am doing is that when Click in All button in range selector button then All data fetching from database and bind this data to datapoints then I will be render chart again. After render chart All button selected color automatically remove. I have using stockChart.rangeSelector.buttons[5].parent.buttonStyle.set(“backgroundColorOnSelect”, “#ff9800”); line of code but it is not working. Please suggest
    This is jsfiddle code
    https://jsfiddle.net/9uLhfpbq/

    #41380

    @rajeshpdsij-in,

    You can set selectedRangeButtonIndex property to e.index value in rangeChanged event handler to highlight the button selected after manipulating with data. Please take a below code snippet for the same.

    stockChart.rangeSelector.set("selectedRangeButtonIndex", e.index)

    Also, checkout this updated JSFiddle for complete working code.

    —-
    Manoj Mohan
    Team CanvasJS

    #41747

    Thanks it is working….

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

You must be logged in to reply to this topic.