Timeline display Half a year

Dear everyone,

Wondering how to display half a year or a semester into the timeline. From example I can display full month as per example in sample but struggle to do as half a year or for a longer period of time.

Thanks for the help

Hello @peuportier ,

You can display any required range in the timeline by configuring the x_step, x_unit and x_size properties of the createTimelineView method:
https://docs.dhtmlx.com/scheduler/api__scheduler_createtimelineview.html

Where the x_size is count of x_unit elements on the view.

Here is example with half a year timeline:

scheduler.createTimelineView({
  name:	"timeline",
  x_unit:	"month",
  x_date:	"%M",
  x_step:	1,
  x_size: 6,
  x_start: 0,
  x_length: 6,
  y_unit:	sections,
  y_property:	"section_id",
  render:"bar",
});

Here is a demo:
https://snippet.dhtmlx.com/c93lg1yp

Kind regards,

1 Like

Hello @Siarhei

First, Thank you for your time.
Your insights were helpful. But my idea is to arrive more like this?

How do I Set the timeline for displaying the length according to my screenshot?
I Wish you a nice day!

Regards

hello @Siarhei i try this way

scheduler.createTimelineView({
				name: view_name,
				x_unit: "week",
				x_date: "%W <br> %d",
				x_step: 1,
				x_size: 1,
                scrollable:true,
				scroll_position: new Date(),
				section_autoheight: true,
				y_unit:   sections,
				y_property: "section_id",
				render:"bar",
				round_position:true,
				dy:80,
                second_scale:{
                    x_unit: "month", // unit which should be used for second scale
                    x_date: "%F" // date format which should be used for second scale, "July 01"
                }
			});

However, it appears chaotic.

Do you have any suggestions on how to get close to my model?
Two scales are present on the top, one for a month and the other for a week, each of which has a vertical bar for each day, similar to a ruler.

Thanks you