Skip to content
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
Harvzor opened this issue Nov 29, 2017 · 4 comments
Closed

Comments

@Harvzor
Copy link

@Harvzor Harvzor 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!

@Harvzor Harvzor changed the title Highstocks rangeSelector, `selected` not working on button with `offsetMin` Highstocks rangeSelector, `selected` not working on button with `offsetMin` (v6.0.3) Nov 29, 2017
@KacperMadej
Copy link
Contributor

@KacperMadej KacperMadej commented Nov 29, 2017

Hi,

Thank you for reporting about the problem.

@KacperMadej
Copy link
Contributor

@KacperMadej KacperMadej commented Nov 30, 2017

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

@gemadang
Copy link

@gemadang gemadang commented Jun 14, 2019

Sorry why was this closed, was there a solution to this bug that was issued 2 years ago?

@pawelfus
Copy link
Contributor

@pawelfus pawelfus commented Jun 17, 2019

Hi @gemadang

Yes, this is fixed. Above your message, a commit is referenced that closed this issue:

Screen Shot 2019-06-17 at 09 52 53

Commit: 279530c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants