search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How set the scale resp. the zoom automatically on the number of days

Asked by Anonymous
2 years ago.

Hi,
Is it possible to let the scale be calculated automatically based on the number of days. If the total number of days e. g. is 30, the scale should be in days. If the total number of days is 200, the scale should be in months, etc.
I want the scheduler's width to be always 100% without scrolling but with readable scale. If the scale is in days e. g. and I have to render 200 days, then it is not that readable.

Answer posted by Dan Letecky [DayPilot]
2 years ago.

The built-in zoom system (see the tutorial at https://code.daypilot.org/32893/javascript-scheduler-zoom) lets you specify the values either statically or using a function. If you use a function you will be able to apply your own logic for calculating the scale.

You can get the current width of the Scheduler viewport from "dp.nav.scroll.offsetWidth". Just note that this is an internal property that is not guaranteed to be available in the future.

Comment posted by Anonymous
2 years ago.

OK. I already know the built-in zoom. I'll solve the issue using it.

However, it would be nice if you would think about implmenting this as a new feature or at least if you could publish a tutorial on how to do it the most effectiv way using the built-in zoom.

Basically you would set the property timeHeaders with the appropriate values for groupBy and format depending on the size of the date range.

Thank you.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.