Articles in this section
Category / Section

How to ZoomIn and ZoomOut the Scheduler?

2 mins read

This knowledge base article explains the way to ZoomIn and ZoomOut the Scheduler.

 

Step 1: Create an Angular Scheduler by referring the following User Guide link.

https://ej2.syncfusion.com/angular/documentation/schedule/getting-started/#create-an-angular-application

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 buttons 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 the example from the following GitHub link.

Example – Scheduler_Zoom


Conclusion

I hope you enjoyed learning about how to ZoomIn and ZoomOut the Scheduler.

You can refer to our JavaScript Schedule feature tour page to know 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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied