How to add dashed line and don't show a line between marks in syncfusion_flutter_charts in certain conditions

Screenshot 2022-11-05 at 2.31.37 AM.png

As shown in the diagram based on the date if the user didn't perform any action in 3 days there must be no line between 2 points and if the action is after 2 days show a dashed line between points.


1 Reply

SK Sriram Kiran Senthilkumar Syncfusion Team November 7, 2022 03:48 PM UTC

Hi Ahmed,


This requirement "how to add dashed and don’t show a line between marks" can be achieved by using the onCreateRenderer callback that is available in chart series. To render a dashed line for the specific segment using the current segment index value, the existing line series renderer class can be overridden with a custom line series renderer class to get all series segment index value. You can also achieve the space between the points by using empty points.


Screenshot:


You can refer the below attached sample along with user guide documentation for more details about onCreateRenderer callback.

https://help.syncfusion.com/flutter/cartesian-charts/callbacks#oncreaterenderer


Regards,

Sriram Kiran


Attachment: i418052_78cca894.zip

Loader.
Up arrow icon