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

Dotted line in chart

Hello,

I would like to create a dotted (or dashed) line in a chart.

Thank in advance,

Have a nice day.


3 Replies

SS Sheik Syed Abthaheer M Syncfusion Team June 21, 2013 12:58 PM UTC

Hi Anthony,

 

Thanks for using Syncfusion products.

 

You can achieve your requirement (Dotted LineSeries) by overriding custom Line Chart template as shown in the given code snippet.

 

Code Snippet [Xaml]:

<DataTemplate x:Key="LineSegment">

   <Canvas Background="Transparent" HorizontalAlignment="Left" VerticalAlignment="Top">

      <Line Stroke="{Binding Interior}" StrokeThickness="{Binding StrokeThickness}"                                  StrokeDashArray="1,1"  X1="{Binding X1}" X2="{Binding X2}" Y1="{Binding Y1}" Y2="{Binding Y2}" Opacity="{Binding Opacity}"/>

    /Canvas>

</DataTemplate>

<syncfusion:ChartSeries Type="Line” SegmentTemplate="{StaticResource LineSegment}" DataSource="{Binding power}" BindingPathX="Year" BindingPathsY="ind" />

                

We have prepared the sample based on your requirement. Please download it from the given below location.

 

Please let us know if you have any queries.

 

Regards,

M. Sheik



DottedLineChart_8732b170.zip


AP Anthony PALLINI June 27, 2013 02:19 PM UTC

Thanks for the answer.

Can you give me the way to do that by code, in our project we create series from code.
I use syncfusion 10.2 version, does it change something in the exemple ?


regards.



SS Sheik Syed Abthaheer M Syncfusion Team July 1, 2013 10:12 AM UTC

Hi Anthony,

Thanks for your update.

We have prepared the dotted lineChart programmatically(by using C#) based on your requirement.

Please find the sample from the given below location.

Please let us know if you have any queries.

Regards,

M. Sheik



DottedLineChart_e5a6e4f.zip

Loader.
Live Chat Icon For mobile
Up arrow icon