Articles in this section
Category / Section

How to add prefix and suffix for axis labels in JavaScript 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.

JS

$("#container").ejChart({
    primaryXAxis: {
        labelFormat: "${value} K"
    }
});

 

The following screenshot displays the primary X axis with “$” as prefix and “K” as suffix.

The prefix and suffix for axis labels in Chart

JS Playground sample link: Label Prefix and Suffix

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied