How to Format the Tooltip and Data Labels in Blazor Charts?
This article explains how to format the tooltip and data labels in Syncfusion Blazor Accumulation Charts.
Formatting tooltip and data labels
In Blazor Accumulation Charts, you can customize the format of data labels and tooltips using the following properties:
- Format property in AccumulationDataLabelSettings – used to format data labels.
- Format property in AccumulationChartTooltipSettings – used to format tooltips.
Example: Format tooltip and data labels in an Accumulation Chart
The following example demonstrates how to format the tooltip and data labels using currency formatting:
@using Syncfusion.Blazor.Charts
<SfAccumulationChart Title="Mobile Browser Statistics">
<AccumulationChartSeriesCollection>
<AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users">
<AccumulationDataLabelSettings Visible="true" Format="C1"></AccumulationDataLabelSettings>
</AccumulationChartSeries>
</AccumulationChartSeriesCollection>
<AccumulationChartTooltipSettings Header="" Format="${point.x}: $${point.y}" Enable="true"></AccumulationChartTooltipSettings>
</SfAccumulationChart>
@code {
public class Statistics
{
public string Browser { get; set; }
public double Users { get; set; }
}
public List<Statistics> StatisticsDetails = new List<Statistics>
{
new Statistics { Browser = "Chrome", Users = 37.3 },
new Statistics { Browser = "UC Browser", Users = 17.4 },
new Statistics { Browser = "iPhone", Users = 19.6 },
new Statistics { Browser = "Others", Users = 4.2 },
new Statistics { Browser = "Opera", Users = 11.7 },
new Statistics { Browser = "Android", Users = 12.8 },
};
}
Output
The following screenshot illustrates the formatted tooltip and data labels in the chart:
Live Sample
You can try this feature in the live sample
Conclusion:
We hope you found this guide helpful in learning How to Format the Tooltip and Data Labels in Blazor Charts. For more features, visit our [Blazor Charts feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our [Blazor Charts 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!