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

Add lines to diagram

Hi,

is it possible to add (thick) horizontal or vertical lines to a chart? I don't mean the grid that is already present but a thicker line to maybe visually separate parts of the chart.

Best,
Jan Malte

5 Replies

YP Yuvaraj Palanisamy Syncfusion Team May 7, 2015 12:25 PM UTC


Hi Jan Malte,
Thanks for using Syncfusion Products,
We would like to let you know that we can achieve your requirement using LineSeries with two data points. We have also prepared a sample for your reference, please find the sample from the following link,
Sample : http://www.syncfusion.com/downloads/support/forum/119053/StripLine373322043.zip
(Note: In future we will provide StripLines feature to achieve this requirement in a simple manner)
Please let us know if you require further assistance on this.
Thanks,
Yuvaraj P


JM Jan Malte Dittmer May 7, 2015 01:14 PM UTC

Hi Yuvaraj,

thank you for pointing me in the right direction again!
Do you know already the date when the new feature goes live?

Best,
Jan Malte


YP Yuvaraj Palanisamy Syncfusion Team May 8, 2015 04:50 AM UTC

Hi Jan,

We would like to let you know that new features will be available in our upcoming main release Volume 2, 2015 release which is scheduled to release in end of June 2015.

Please let us know if you require further assistance on this.

Thanks,
Yuvaraj P


JM Jan Malte Dittmer May 8, 2015 07:19 PM UTC

Hi Yuvaraj,

when I try your example everything works fine but when I try to use this in my project I get a "can't cast from source to target" exception.
My code looks like this:

NumericalAxis xAxis = new NumericalAxis
{
Title = new ChartAxisTitle{ Text = "Fortschritt" },
MajorTickStyle = new ChartAxisTickStyle{ TickSize = 0 },
EdgeLabelsDrawingMode = EdgeLabelsDrawingMode.Shift,
Interval = 1,
Minimum = 0,
Maximum = 9
};
xAxis.LabelCreated += onLabelCreated;

NumericalAxis yAxis = new NumericalAxis 
{
Title = new ChartAxisTitle{ Text = "Erinnerung" },
//LabelStyle = new ChartAxisLabelStyle{ TextColor = Color.White },
MajorTickStyle = new ChartAxisTickStyle{ TickSize = 0 },
Interval = 1,
Minimum = 0,
Maximum = 8
};

diagram.PrimaryAxis = xAxis;
diagram.SecondaryAxis = yAxis;

var lineData = new ObservableCollection<ChartDataPoint>
{
new ChartDataPoint(0, 5),
new ChartDataPoint(8, 5)
};

LineSeries lineSeries = new LineSeries
{
ItemsSource = lineData,
StrokeWidth = 5,
Color = Color.Blue
};

diagram.Series.Add(lineSeries);

Without the LineSeries everything works.


YP Yuvaraj Palanisamy Syncfusion Team May 9, 2015 06:20 AM UTC

Hi Jan,

We have created the sample using your code, but the sample working fine without any issue. Please check the attached sample from the following location. If you still face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you better.

Sample : http://www.syncfusion.com/downloads/support/forum/119053/StripLine-1982869422.zip

Please let us know if you have any queries.

Thanks,
Yuvaraj P

Loader.
Live Chat Icon For mobile
Up arrow icon