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

Dotted or dashed ChartStripLine

Hello,

I need to represent a dotted or dashed Horizontal ChartStripLine inside a sfChart.

In this forum I have seen two workarounds to this problem but unfortunately no one satisfy my needs.

The first one is a solution for MVC where the rect elements of the ChartStripLine are replaced with other xaml element via javascript (I am not sure if this solution is feasible via C#?)
The second one is to use a LineSeries with its own ObservableCollection instead the ChartStripLine ( That means I need to create an ObservableCollection where all the elements have the same value, which I do not find elegant at all).

Am I wrong in my arguments? Is there any alternative workaround?

Thank you very much

4 Replies

SJ Sumathi Jayaraj Syncfusion Team April 9, 2015 05:38 AM UTC

Hi Perez,

Thank you for contacting Syncfusion support.

We have drawn stripline as a rectangle and there are no support to customize the stripline as a dotted or dashed line. Alternatively, we can use the horizontal or vertical line annotation to represent the dashed line for your requirement. We have prepared a sample based on your requirement and please find the sample in the below location.

Sample: StriplineSample.zip

Please let us know if you have any queries.

Regards,
Sumathi J


JP Jesus Perez Valle April 9, 2015 07:33 AM UTC

Wonderful, that is exactly what I need.

Thank you very much!


JP Jesus Perez Valle April 9, 2015 09:59 AM UTC

After integrating horizontal line annotations in my project, I would like to ask two questions:

- When the HorizontalLineAnnotation  crosses my data series, it hides the data. Is it possible to have the HorizontalLineAnnotation in Background?
- For readability reasons, I would like to have the Axis Labels of the vertical axis on the left side of the chart and the AxisLabel of the HorizontalLineAnnotation on the right side. Is this possible by editing the AxisLabel of the HorizontalLineAnnotation DataTemplate?

Thanks in advance


SJ Sumathi Jayaraj Syncfusion Team April 10, 2015 10:43 AM UTC

Hi Jesus,

Thanks for the update.

Query 1: Is it possible to have the HorizontalLineAnnotation in Background?

We would like to let you know that by default, Annotations are placed on the top of the series. However we have achieved your requirement in a workaround by overriding the SfChart and placed the annotation canvas in the bottom of the chart.

Query 2: I would like to have the Axis Labels of the vertical axis on the left side of the chart and the AxisLabel of the HorizontalLineAnnotation on the right side.

We are not having the direct API to display AxisLabels of Annotation in the opposite position of ChartAxis (i.e., right side). Alternatively, we have defined two YAxis to display the axis label of annotation in right side.

Query 3: Is this possible by editing the AxisLabel of the HorizontalLineAnnotation Data Template?

We are able to customize the AxisLabel of the Annotation by using “AxisLabelTemplate”.

We have modified the sample based on your requirements and it can be downloaded from the below location.

Sample: StriplineSample.zip

Please refer the below link for more information of Annotations

Link: http://help.syncfusion.com/ug/wpf/Documents/annotations.htm

Please let us know if you need any further assistance on this.

Regards,
Sumathi J

Loader.
Live Chat Icon For mobile
Up arrow icon