We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

'Need to show chart strip lines as dotted lines' - F 118447

Hello Syncfusion Team,

I tried achieving the same functionality in xamarin forms in XAML as follows:







                                Text="100" />


In our case, this stripline is not the primary or secondary axis. This piece of code didn't work. Can you please look into it?


Satya K.

1 Reply

RR Raja Ramalingam Syncfusion Team January 26, 2023 10:28 AM UTC

Hi Satya,

We suggest using HorizontalLineAnnotation in chart and utilizing the StrokeDashArray property to achieve your requirement for dotted lines. Please see the code snippet below as an example.



    <xForms:HorizontalLineAnnotation Text="High" x:Name="annotation1" StrokeWidth="3" StrokeColor="Green" Y1="40" CoordinateUnit="Axis">


            <x:Array Type="{x:Type x:Double}">







    <xForms:HorizontalLineAnnotation Text="Low" x:Name="annotation2" StrokeWidth="3" StrokeColor="Red" Y1="10" CoordinateUnit="Axis">


            <x:Array Type="{x:Type x:Double}">








Note: You may face errors while setting values for StrokeDashArray property like above. Those errors are XAML syntax level only.

You can also set stroke dash array value from code behind like below.

annotation1.StrokeDashArray = new double[] { 2,3};


annotation2.StrokeDashArray = new double[] { 2,3};


Please visit the UG documentation of annotations in chart.


Best Regards,


Attachment: DottedLinesChartSample_20105495.zip

Live Chat Icon For mobile
Up arrow icon