How to Apply Rounded Corners to Column Series points in Angular Chart?
This article explains how to apply rounded corners to column series points in an Angular Chart based on the point value. Using the chart’s pointRender event, you can dynamically set top corner radii for positive values and bottom corner radii for negative values.
Steps to Implement
- Add a Column series to the Angular Chart.
- Bind the pointRender event to the chart.
- In the event handler:
- Check the point’s y value.
- Set series.cornerRadius accordingly:
- For positive values, apply topLeft and topRight corner radius.
- For negative values, apply bottomLeft and bottomRight corner radius.
Code Example
app.component.html
<ejs-chart (pointRender)="pointRender($event)">
........
</ejs-chart>
app.component.ts
public pointRender(args): void {
if (args.point.y > 0) {
args.series.cornerRadius = {
topLeft: 5,
topRight: 5,
bottomLeft: 0,
bottomRight: 0,
};
} else {
args.series.cornerRadius = {
bottomLeft: 5,
bottomRight: 5,
topLeft: 0,
topRight: 0,
};
}
}
Output
Live Sample
Conclusion
I hope you enjoyed learning about how to apply rounded corners to column series points in Angular Chart.
You can refer to our Angular Chart’s feature tour page to learn about its other groundbreaking feature representations. You can also explore our Angular Chart Documentation to understand how to present and manipulate data.
For current customers, you can check out our Angular components on the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to explore our Angular Chart and other Angular components.
If you have any queries or require clarifications, please let us know in the comments below. You can also contact us through our support forums, Direct-Trac or feedback portal, or the feedback portal. We are always happy to assist you!