How can the globalized axis label be further formatted in Angular Charts?
Description
This article shows how the globalized axis label can be further formatted in Angular Charts.
Solution
To format axis labels in Syncfusion Angular Charts, you can utilize the labelFormat property in the Axis configuration. This property allows you to specify various globalized formats such as n1, p1, c1, etc., for numeric labels.
In addition to the global format, for more advanced customization, you can utilize the IAxisLabelRenderEventArgs event. This involves subscribing to the axisLabelRender event and implementing a custom event handler. Inside this handler, you can dynamically modify the content or styling of axis labels based on various conditions.
Code Snippet
app.component.ts
public primaryYAxis: Object = {
labelFormat: 'n1'
};
public axisLabelRender(args): void {
if(args.axis.name === "primaryYAxis") {
args.text = args.text + ' l/min';
}
};
The following image illustrates the output of the above code:
Refer to the working sample for additional details and implementation:View Sample in Stackblitz
Conclusion
We hope you enjoyed learning how can the globalized axis label be further formatted in Angular Charts.
You can refer to our Angular Charts feature tour page to learn about its other features and documentation, and how to quickly get started for configuration specifications. You can also explore our Angular Charts example to understand how to create and visualize 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 comment section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!