flrs / visavail

A D3.js Time Data Availability Visualization
https://flrs.github.io/visavail/docs/samples/basic.html
MIT License
310 stars 59 forks source link

Continuous Time Span of 1hr duration in X-Axis #22

Closed Passwrod closed 4 years ago

Passwrod commented 6 years ago

Hi, I am using visavail chart to show a dataset. The time duration in X-Axis is getting auto adjusted as per the dataset start and end time. But I want to keep the time span as static with a duration gap of 1 hr in X-Axis. This will help me have a more granular view of the data set that is plotted.

Is it possible to achieve this?

Thanks In Advance.

Regards, Shitikantha Nanda

FunDeckHermit commented 6 years ago

You could edit the vasavail.js script to define the startdate and enddate as a whole hour.

startDate.setMinutes (startDate.getMinutes() - 30); //get previous hour startDate.setMinutes(0); endDate.setMinutes (endDate.getMinutes() + 30); //get next hour endDate.setMinutes(0); // define scales etc etc.

tanganellilore commented 4 years ago

hi @Passwrod ,

now we have visavail 2.0 and the funcito is now present to display dataset in a specific time range.

the function thath you can cll is "displayDateRange(display_date_range, dataset)", display_date_range is an arry with 2 element [start_date, end_date].

Enjoy with visavail 2.0