How to display chart tooltip with thousand separator in Blazor Charts?
This article explains how to display chart tooltip with thousand separators in Blazor Charts.
Display Chart Tooltip with Thousand Separator
Blazor Charts provides an option to display chart tooltip with thousand separator.
This can be achieved by enabling the UseGroupingSeparator property to display chart tooltips with thousand separators in charts.
The below code example demonstrates how to display chart tooltips with thousand separators
Index.razor
@using Syncfusion.Blazor.Charts
@using System.Globalization
<SfChart UseGroupingSeparator="true">
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
<ChartTooltipSettings Enable="true" />
<ChartSeriesCollection>
<ChartSeries DataSource="@MedalDetails" XName="X" YName="Y" Type="ChartSeriesType.Line">
</ChartSeries>
</ChartSeriesCollection>
</SfChart>
@code {
public class ChartData
{
public string X { get; set; }
public double Y { get; set; }
}
public List<ChartData> MedalDetails = new List<ChartData>
{
new ChartData { X= "South Korea", Y= 34224 },
new ChartData { X= "India", Y= 53252 },
new ChartData { X= "Pakistan", Y= 52352 },
new ChartData { X= "Germany", Y= 24342 },
new ChartData { X= "Australia", Y= 42332 },
new ChartData { X= "Italy", Y= 64352 },
new ChartData { X= "United Kingdom", Y= 35455 },
new ChartData { X= "Saudi Arabia", Y= 53234 },
new ChartData { X= "Russia", Y= 62323 },
new ChartData { X= "Mexico", Y= 36432 },
new ChartData { X= "Brazil", Y= 42342 },
new ChartData { X= "China", Y= 63433 }
};
}
The following screenshot illustrates the output of the code snippet.
Live sample for display the chart tooltips with thousand separators
Conclusion
I hope you enjoyed learning how to display chart tooltips with thousand separators in Blazor Charts.
You can refer to our Blazor Chart 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 Blazor Chart 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 forums, support portal, or feedback portal. We are always happy to assist you!