# chart-zooming

> Line chart of monthly temperature anomalies with selection, mouse-wheel, pinch zoom and scrollbar.

**Framework:** aspnet-core  **Component:** Chart  **Variant:** zooming

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/aspnet-core/chart-zooming.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.Charts
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/chart-zooming/chart.cshtml

```cshtml
@page
@namespace aspnet_core.Chart.Zooming
@model EJ2CoreSampleBrowser.Chart.Zooming.ZoomingModel
@using Syncfusion.EJ2
<ejs-chart id="container" load="window.load" width="60%">
        <e-chart-primaryxaxis valueType="DateTime"></e-chart-primaryxaxis>
        <e-chart-legendsettings visible="false"></e-chart-legendsettings>
        <e-chart-zoomsettings enableMouseWheelZooming="true" enablePinchZooming="true" enableSelectionZooming="true"></e-chart-zoomsettings>
        <e-series-collection>
            <e-series xName="x" width=2 yName="y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Area"></e-series>
        </e-series-collection>
</ejs-chart>
<script>
    var series1 = [];
    var point1;
    var value = 40;
    var i;
    for (i = 1; i < 9; i++) {
        if (Math.random() > .5) {
            value += Math.random();
        }
        else {
            value -= Math.random();
        }
        point1 = { x: new Date(1950, i + 2, i), y: value.toFixed(1) };
        series1.push(point1);
    }
    window.load = function (args) {
        args.chart.series[0].dataSource = series1;
    }
</script>
```

### src/components/chart-zooming/chart.cshtml.cs

```cs
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace EJ2CoreSampleBrowser.Chart.Zooming
{
    public class ZoomingModel : PageModel
    {
        public List<TemperatureData> TemperatureData { get; set; }

        public void OnGet()
        {
            TemperatureData = new List<TemperatureData>
            {
                new TemperatureData { Month = "Jan", Anomaly = 0.8 },
                new TemperatureData { Month = "Feb", Anomaly = 1.2 },
                new TemperatureData { Month = "Mar", Anomaly = 0.6 },
                new TemperatureData { Month = "Apr", Anomaly = -0.3 },
                new TemperatureData { Month = "May", Anomaly = 0.4 },
                new TemperatureData { Month = "Jun", Anomaly = 1.1 },
                new TemperatureData { Month = "Jul", Anomaly = 1.5 },
                new TemperatureData { Month = "Aug", Anomaly = 1.3 },
                new TemperatureData { Month = "Sep", Anomaly = 0.7 },
                new TemperatureData { Month = "Oct", Anomaly = 0.2 },
            };
        }
    }

    public class TemperatureData
    {
        public string Month { get; set; }
        public double Anomaly { get; set; }
    }
}

```
