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

Use a date selector for slider input fields with a Datetime axis #41

Open
AleksueiR opened this issue May 10, 2018 · 2 comments
Open

Use a date selector for slider input fields with a Datetime axis #41

AleksueiR opened this issue May 10, 2018 · 2 comments
Milestone

Comments

@AleksueiR
Copy link
Member

Read #4 (comment) for more information.

@mweech mweech added this to the DQVue v0.6.0 milestone May 22, 2018
@AleksueiR
Copy link
Member Author

AleksueiR commented Jun 11, 2018

Okay, this is way more complicated than I expected. Time is hard.

NoUISlider library doesn't handle dates directly, but it work with Linux timestamps. The Highcharts also accepts Linux timestamps. To properly use dates, chart data should already contain proper date values in the form of timestamps or other formats that Highcharts can interpret as dates (YYYY-mm-dd for example, etc.). If the data does not have timestamps and values on the X-axis are generated with a simple interval, the start point, interval and interval unit need to be specified. Something like this:

plotOptions: {
                            area: {
                                pointStart: Date.UTC(1940, 0),
                                pointInterval: 1,
                                pointIntervalUnit: 'year',
}}

The current idea is to provide three options for the slider's input fields:

  • year
  • year and month
  • year, month, day

The config author needs to specify the correct date option on the slider config. Otherwise, the slider will default to treating the timestamps as actual values. The slider will work, but the value will be incomprehensible to the users:

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

No branches or pull requests

2 participants