# chart-line

> Multi-series line chart compares annual crude steel production by country with date axes, markers, and tooltips.

**Framework:** blazor  **Component:** Chart  **Variant:** line

## 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/blazor/chart-line.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Blazor.Charts
```

**Notes**

- Syncfusion release: 2026 Volume 2 (v34.1.29)
- 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-line/Chart.razor

```razor
@page "/chart/line"
@using Syncfusion.Blazor.Charts

<div class="control-section" align='center'>
    <SfChart Title="Annual Crude Steel Production by Country (2016–2024)" SubTitle="Source: wikipedia.org" Width="@Width">
        <ChartTitleStyle TextOverflow="TextOverflow.Wrap"></ChartTitleStyle>
        <ChartSubTitleStyle TextOverflow="TextOverflow.Wrap"></ChartSubTitleStyle>
        <ChartArea><ChartAreaBorder Width="0"></ChartAreaBorder></ChartArea>
        <ChartMargin Bottom="12"></ChartMargin>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime" EdgeLabelPlacement="EdgeLabelPlacement.Shift">
            <ChartAxisMajorGridLines Width="0"></ChartAxisMajorGridLines>
        </ChartPrimaryXAxis>
        <ChartPrimaryYAxis Title="Volume in million metric tons" Minimum="0" Interval="5" Maximum="25" RangePadding="ChartRangePadding.None">
            <ChartAxisLineStyle Width="0"></ChartAxisLineStyle>
            <ChartAxisMajorTickLines Width="0"></ChartAxisMajorTickLines>
        </ChartPrimaryYAxis>
        <ChartTooltipSettings Enable="true" EnableHighlight="true" ShowNearestTooltip="true" Header="<b>${series.name}</b>" Format="${point.x} : <b>${point.y}M</b>"></ChartTooltipSettings>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@VietnamData" Name="Vietnam" XName="X" Width="2"
                         Opacity="1" YName="Y" Type="ChartSeriesType.Line">
                <ChartMarker Visible="true" Width="7" Height="7" IsFilled="true" Shape="ChartShape.Circle">
                </ChartMarker>
                <SeriesLabelSettings Visible="true">
                </SeriesLabelSettings>
            </ChartSeries>
            <ChartSeries DataSource="@IndonesiaData" Name="Indonesia" XName="X" Width="2"
                         Opacity="1" YName="Y" Type="ChartSeriesType.Line">
                <ChartMarker Visible="true" Width="6" IsFilled="true" Height="6" Shape="ChartShape.Triangle">
                </ChartMarker>
                <SeriesLabelSettings Visible="true">
                </SeriesLabelSettings>
            </ChartSeries>
            <ChartSeries DataSource="@FranceData" Name="France" XName="X" Width="2"
                         Opacity="1" YName="Y" Type="ChartSeriesType.Line">
                <ChartMarker Visible="true" Width="7" IsFilled="true" Height="7" Shape="ChartShape.Diamond">
                </ChartMarker>
                <SeriesLabelSettings Visible="true">
                </SeriesLabelSettings>
            </ChartSeries>
            <ChartSeries DataSource="@PolandData" Name="Poland" XName="X" Width="2"
                         Opacity="1" YName="Y" Type="ChartSeriesType.Line">
                <ChartMarker Visible="true" Width="5" IsFilled="true" Height="5" Shape="ChartShape.Rectangle">
                </ChartMarker>
                <SeriesLabelSettings Visible="true">
                </SeriesLabelSettings>
            </ChartSeries>
            <ChartSeries DataSource="@MexicoData" Name="Mexico" XName="X" Width="2"
                         Opacity="1" YName="Y" Type="ChartSeriesType.Line">
                <ChartMarker Visible="true" Width="7" IsFilled="true"  Height="7" Shape="ChartShape.Pentagon">
                </ChartMarker>
                <SeriesLabelSettings Visible="true">
                </SeriesLabelSettings>
            </ChartSeries>
        </ChartSeriesCollection>
        <ChartLegendSettings EnableHighlight="true"></ChartLegendSettings>
    </SfChart>
</div>
@code{
    public string Width { get; set; } = "90%";

   public class ChartData
    {
        public DateTime X { get; set; }
        public double Y { get; set; }
    }
    public List<ChartData> VietnamData = new List<ChartData>
    {
       new ChartData { X = new DateTime(2016, 01, 01), Y = 7.8 },
       new ChartData { X = new DateTime(2017, 01, 01), Y = 10.3 },
       new ChartData { X = new DateTime(2018, 01, 01), Y = 15.5 },
       new ChartData { X = new DateTime(2019, 01, 01), Y = 17.5 },
       new ChartData { X = new DateTime(2020, 01, 01), Y = 19.5 },
       new ChartData { X = new DateTime(2021, 01, 01), Y = 23.0 },
       new ChartData { X = new DateTime(2022, 01, 01), Y = 20.0 },
       new ChartData { X = new DateTime(2023, 01, 01), Y = 19.0 },
       new ChartData { X = new DateTime(2024, 01, 01), Y = 22.1 }
    };
    public List<ChartData> IndonesiaData = new List<ChartData>
    {
       new ChartData { X = new DateTime(2016, 01, 01), Y = 4.8 },
       new ChartData { X = new DateTime(2017, 01, 01), Y = 5.2 },
       new ChartData { X = new DateTime(2018, 01, 01), Y = 6.2 },
       new ChartData { X = new DateTime(2019, 01, 01), Y = 7.8 },
       new ChartData { X = new DateTime(2020, 01, 01), Y = 9.3 },
       new ChartData { X = new DateTime(2021, 01, 01), Y = 14.3 },
       new ChartData { X = new DateTime(2022, 01, 01), Y = 15.6 },
       new ChartData { X = new DateTime(2023, 01, 01), Y = 16.0 },
       new ChartData { X = new DateTime(2024, 01, 01), Y = 17.0 }
    };
    public List<ChartData> FranceData = new List<ChartData>
    {
       new ChartData { X = new DateTime(2016, 01, 01), Y = 14.6 },
       new ChartData { X = new DateTime(2017, 01, 01), Y = 15.5 },
       new ChartData { X = new DateTime(2018, 01, 01), Y = 15.4 },
       new ChartData { X = new DateTime(2019, 01, 01), Y = 14.4 },
       new ChartData { X = new DateTime(2020, 01, 01), Y = 11.6 },
       new ChartData { X = new DateTime(2021, 01, 01), Y = 13.9 },
       new ChartData { X = new DateTime(2022, 01, 01), Y = 12.1 },
       new ChartData { X = new DateTime(2023, 01, 01), Y = 10.0 },
       new ChartData { X = new DateTime(2024, 01, 01), Y = 10.8 }
    };
    public List<ChartData> PolandData = new List<ChartData>
    {
       new ChartData { X = new DateTime(2016, 01, 01), Y = 8.9 },
       new ChartData { X = new DateTime(2017, 01, 01), Y = 10.3 },
       new ChartData { X = new DateTime(2018, 01, 01), Y = 10.8 },
       new ChartData { X = new DateTime(2019, 01, 01), Y = 9.0 },
       new ChartData { X = new DateTime(2020, 01, 01), Y = 7.9 },
       new ChartData { X = new DateTime(2021, 01, 01), Y = 8.5 },
       new ChartData { X = new DateTime(2022, 01, 01), Y = 7.4 },
       new ChartData { X = new DateTime(2023, 01, 01), Y = 6.4 },
       new ChartData { X = new DateTime(2024, 01, 01), Y = 7.1 }
    };
    public List<ChartData> MexicoData = new List<ChartData>
    {
       new ChartData { X = new DateTime(2016, 01, 01), Y = 19.0 },
       new ChartData { X = new DateTime(2017, 01, 01), Y = 20.0 },
       new ChartData { X = new DateTime(2018, 01, 01), Y = 20.2 },
       new ChartData { X = new DateTime(2019, 01, 01), Y = 18.4 },
       new ChartData { X = new DateTime(2020, 01, 01), Y = 16.8 },
       new ChartData { X = new DateTime(2021, 01, 01), Y = 18.5 },
       new ChartData { X = new DateTime(2022, 01, 01), Y = 18.4 },
       new ChartData { X = new DateTime(2023, 01, 01), Y = 16.3 },
       new ChartData { X = new DateTime(2024, 01, 01), Y = 13.7 }
    };
}

```
