Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Modify node shape in line chart depending on data

Answered
Anuroop Pendela asked 1 day ago

Hello Flexmonster team,
We have a requirement where we need to show different shapes based on data (either x or y) of the line chart. For now, if the y-axis data is 0, then we need to render a rhombus or triangle. And for other cases, we need to show the default circle. Is it possible with flex monster? I am using flex monster in react framework with typescript. Please help us out on this. 
Thank you!

1 answer

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster 12 hours ago

Hello,
 
Thank you for reaching out.
 
We suggest using the customizeChartElement hook to perform such customization. This API call allows customizing separate chart elements in Flexmonster Charts. For example, you can add custom attributes or set element colors. For example, you can replace the SVG element representing the circle with the desired one based on the value passed to the handler.
 
You are welcome to see the JSFiddle we have prepared for a reference: https://jsfiddle.net/flexmonster/g7wx8qkv/.
 
Please let us know if it works for you.
Looking forward to hearing the feedback.
 
Regards,
Illia

Please login or Register to Submit Answer