Exact date in EJ2 JavaScript Chart control

8 May 20231 minute to read

By using button click you can show exact time or month after scrolling. Here we have changed zooFactor and zoomPosition based on time or month requirement. After scrolling you want show full month or full day data then you will customize the zoomFactor and zoomPosition of the chart and show exact time or month.

<!DOCTYPE html><html lang="en"><head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Typescript UI Controls">
    <meta name="author" content="Syncfusion">
    <link href="index.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/23.1.36/dist/ej2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>

    <div id="container">
            <button id="lastdata">Last Month</button>
            <button id="chartmode">Switch To Hour</button>
        <div id="element" style="height: 300px"></div>

var ele = document.getElementById('container');
if(ele) {
  ele.style.visibility = "visible";
<script src="index.js" type="text/javascript"></script>