Agent-readable demo data

Title
Event Stacking Line Height (JavaScript Scheduler) | DayPilot Pro for JavaScript Demo
Tree
DayPilot JavaScript Demo
Catalog root
Default
Description
The eventStackingLineHeight property is set to 30, so each line of concurrent events takes 30% of the event height.

Inline demo script 1

const dp = new DayPilot.Scheduler("dp", {
            eventHeight: 50,
            eventStackingLineHeight: 30,
            heightSpec: "Max",
            height: 300,
            startDate: "2027-01-01",
            days: 365,
            scale: "Day",
            timeHeaders: [
                {groupBy: "Month", format: "MMM yyyy"},
                {groupBy: "Cell", format: "d"}
            ],
            treeEnabled: true,
            resources: [
                {name: "Room A", id: "A"},
                {name: "Room B", id: "B"},
                {name: "Room C", id: "C"},
                {name: "Room D", id: "D"},
                {name: "Room E", id: "E"},
                {name: "Room F", id: "F"},
                {name: "Room G", id: "G"},
                {name: "Room H", id: "H"},
                {name: "Room I", id: "I"},
                {name: "Room J", id: "J"},
                {name: "Room K", id: "K"}
            ],
            onTimeRangeSelected: async (args) => {
                const modal = await DayPilot.Modal.prompt("New event name:", "Event");
                const name = modal.canceled ? null : modal.result;
                dp.clearSelection();
                if (!name) {
                    return;
                }
                dp.events.add({
                    start: args.start,
                    end: args.end,
                    id: DayPilot.guid(),
                    resource: args.resource,
                    text: name
                });
                dp.message("Created");
            }
        });
        dp.init();
        dp.scrollTo("2027-08-25");

        const app = {
            init() {
                this.loadEventData();
            },
            loadEventData() {
                // generate and load events
                const events = [
                    {
                        id: 1,
                        start: "2027-08-26T00:00:00",
                        end: "2027-09-01T00:00:00",
                        resource: "B",
                        text: "First Event"
                    },
                    {
                        id: 2,
                        start: "2027-08-28T00:00:00",
                        end: "2027-09-02T00:00:00",
                        resource: "B",
                        text: "Second Event"
                    },
                    {
                        id: 3,
                        start: "2027-08-30T00:00:00",
                        end: "2027-09-03T00:00:00",
                        resource: "B",
                        text: "Third Event"
                    }
                ];

                dp.update({events});
            }
        };
        app.init();