test
test

Reputation: 2629

Broken line chart in Microsoft Chart Control

Is it possible to create a broken line chart with the Microsoft chart control?

Similar to this:

Broken Line Chart

Preferably using the same series.

Upvotes: 2

Views: 1122

Answers (1)

Dmitry
Dmitry

Reputation: 14059

Yes, it's possible. You can use the DataPoint.IsEmpty property to indicate blank points.
Sample code:

Series series = new Series("sample") { ChartType = SeriesChartType.Line, BorderWidth = 2, MarkerSize = 5, MarkerStyle = MarkerStyle.Square };
series.Points.Add(new DataPoint(0, 1));
series.Points.Add(new DataPoint(1, 1));
series.Points.Add(new DataPoint(1.5, double.NaN) { IsEmpty = true });
series.Points.Add(new DataPoint(2, 1));
series.Points.Add(new DataPoint(3, 2));
chart.Series.Add(series);

Upvotes: 2

Related Questions