Category / Section
How to add prefix and suffix for axis labels in Chart?
1 min read
Essential Chart supports adding prefix and suffix to axis labels using LabelFormat property of axis. You can add Prefix and suffix to categorical and numerical axes and it is not applicable for date time axis. Refer to Chart Axis for more information about different types of axis supported by Essential Chart. The following code example explains how to add prefix and suffix to numeric axis.
CSHTML
@(Html.EJ().Chart("container") .PrimaryXAxis(axis=> axis.LabelFormat("${value} K")) )
The following screenshot displays the primary X axis with “$” as prefix and “K” as suffix.