You must be logged in to post your query.
Home › Forums › Chart Support › How to All range button set as selected in rangeChanged event
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/
@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
Thanks it is working….
You must be logged in to reply to this topic. Login/Register