New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highstocks rangeSelector, `selected` not working on button with `offsetMin` (v6.0.3) #7467

Closed
HarveyWilliams opened this Issue Nov 29, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@HarveyWilliams

HarveyWilliams commented Nov 29, 2017

Expected behaviour

Using the selected config option in the rangeSelector should select a button by default.

Actual behaviour

No button iselected/s highlighted. Instead, It's like the default option for 1y is being selected where as I need it to use my offsetMin.

Live demo with steps to reproduce

https://jsfiddle.net/h3g09d50/

I have created a custom button with this config:

{
    type: 'year',
    count: 1,
    text: '1y',
    // Commenting out this line causes 1y to get selected.
    offsetMin: -1 * 24 * 3600 * 1000
}

The offsetMin is there so 1 year and 1 day will be shown, so rather than:

2016-11-28 - 2017-11-28

This date range will be used:

2016-11-27 - 2017-11-28

However, the selected field doesn't work with this button.

Commenting out line 28 in the demo (the offsetMin field) causes the selected option to work again.

Thanks for the hard work!

@HarveyWilliams HarveyWilliams changed the title from Highstocks rangeSelector, `selected` not working on button with `offsetMin` to Highstocks rangeSelector, `selected` not working on button with `offsetMin` (v6.0.3) Nov 29, 2017

@KacperMadej

This comment has been minimized.

Contributor

KacperMadej commented Nov 29, 2017

Hi,

Thank you for reporting about the problem.

@KacperMadej

This comment has been minimized.

Contributor

KacperMadej commented Nov 30, 2017

Interna note: time set by selected button in chart config doesn't include offsetMin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment