micronyks
Posts: 13
Joined: Wed Jun 08, 2022 7:23 am

Enable all range selector options and update chart when clicked one of those options

Hi Team,

In range-selector, I have many options to select from (in reality) and in given demo, I initially load last 2 hours data.

In this scenario, last 1 hour option is enabled but other options are disabled.

I really don't know what is wrong. The requirement is to load last 2 hour data first and then from dropdown, you can select other options (eg. last 6 hours) and accordingly data will be loaded.

How to enable other options in range-selector ?

I tried setting

Code: Select all

minRange:1 
but I have no clue how to fix it.

DEMO : https://stackblitz.com/edit/js-2eyktg?f ... ata%2Fi.js


___________________________________________________________________


I tried using

Code: Select all

 allButtonsEnabled: true,
It enables all options but when I click on 3 hours, 6 hours options, it doesn't make any BE call. I believed that it should automatically call afterSetExtremes functions with min & max value, fetch data from BE and update the chart but it doesn't happen.

DEMO : https://stackblitz.com/edit/js-jsxchg?f ... backend.js
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Enable all range selector options and update chart when clicked one of those options

Hi micronyks!
Welcome to our forum and thanks for contacting us with your question!

RangeSelector is a feature which works on fully-loaded data in the chart. Some options from dropdown are disabled because your data is not containing values for 3 or 6 hours. Check this demo below, I have changed the data on the first load to 6 hours, instead of 2 hours before and options in the dropdown are enabled. If you want to download data based on some dropdown you will have to use a custom dropdown, not this one from Highcharts, and write some functions to replace data in the chart.

Demo: https://stackblitz.com/edit/js-fbth1h

Feel free to ask any further questions!
Kind regards!
Hubert Kozik
Highcharts Developer
micronyks
Posts: 13
Joined: Wed Jun 08, 2022 7:23 am

Re: Enable all range selector options and update chart when clicked one of those options

hI hubert.k,

It looks to be working fine. Thanks for the help.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Enable all range selector options and update chart when clicked one of those options

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer

Return to “Highcharts Stock”