How to hide data label in run time in Blazor Chart?

Answer:

We can hide or shown data label in chart using ChartDataLabel property. Here is the code snippet for your reference.

<SfChart >

<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.DateTime">

ChartPrimaryXAxis>


<ChartSeriesCollection>

<ChartSeries DataSource="@WeatherReports" XName="XValue" YName="YValue" Type="ChartSeriesType.Line">

<ChartMarker>

<ChartDataLabel Visible="@isVisible">ChartDataLabel>

ChartMarker>

ChartSeries>

ChartSeriesCollection>

SfChart>

// add your additional code here

ChartComponent>

// add your additional code here

public void OnChange()

{

isVisible = !isVisible;

StateHasChanged();

}


Find the sample to hide data label in run time in Chart from here.

Loader.
Up arrow icon