Category / Section
How to format the tooltip text in ejChart?
1 min read
By default, the x and y value of a point is displayed as the tooltip when you place the mouse over a Chart point. The LabelFormat property of horizontal axis used by the series is used to format the x value displayed in tooltip and the LabelFormat property of vertical axis used by the series is used to format the y value of text displayed in tooltip.
CSHTML
@(Html.EJ().Chart("container") .CommonSeriesOptions(options=> options.Tooltip(tooltip=> tooltip.Visible(true))) .PrimaryYAxis(axis=>axis.LabelFormat("${value} K")) )
The following screenshot displays the Chart with formatted y value of the point in tooltip text.
Figure 1: Chart with formatted tooltip text