How to ZoomIn and ZoomOut the Scheduler?
This article explains the way to ZoomIn and ZoomOut the Scheduler.
Step 1: Create an Angular Scheduler by referring to the following User Guide link.
Step 2: Render the 2 buttons above the Scheduler to Zoom in and out as shown in the following code example.
<div> <button (click)="onZoomIn()">Zoom In(-)</button> <button (click)="onZoomOut()">Zoom Out(+)</button> </div> <ejs-schedule #scheduleObj width='100%' height='550px' [selectedDate]="selectedDate" [eventSettings]="eventSettings"> </ejs-schedule>
Step 3: Increase / decrease the Scheduler width based on the button's click, as shown in the following code example.
onZoomIn(): void {
let scheduleWidth: any = this.scheduleObj.width;
let val: any = scheduleWidth.toString().substring(0, scheduleWidth.length - 1);
this.scheduleObj.width = parseInt(val) - 1 + '%';
this.scheduleObj.refreshEvents();
}
onZoomOut(): void {
let scheduleWidth: any = this.scheduleObj.width;
let val: any = scheduleWidth.toString().substring(0, scheduleWidth.length - 1);
this.scheduleObj.width = parseInt(val) + 1 + '%';
this.scheduleObj.refreshEvents();
}
Step 4: Run the sample, and Scheduler will be zoom in and out based on the buttons click.
Please refer to the example from the following GitHub link.
Example – Scheduler_Zoom
Conclusion
We hope you enjoyed learning about how to ZoomIn and ZoomOut the Scheduler.
You can refer to our JavaScript Schedule feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript Schedule example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!