Insert break in data series of C# chart
I have several data series plotted on a chart. This is logged data spanning several hours. However, there is occasionally a period of 30 minutes where no data is logged. This causes the chart to draw a line between the last sa开发者_运维问答mple before logging stopped and the first sample when logging resumes.
This can appear quite misleading where sudden jumps in data appear. It is preferable to show that there is not logged data in this period.
Is there any way to tell the series not to plot data between two points? So it would still be one series, but with a break in the middle.
If you are asking for microsoft chart controls for .net, you can add an empty data point. Add or create a DataPoint and set it's IsEmpty property to true.
Note that you have to configure the series to show the empty data points.
In addition to @HCL's answer, I think you have to set this property on the series itself in order to show or not missing points (for example when a Y value is double.NaN
):
series.IsXValueIndexed = true;//this allows to NOT draw missing points
From MSDN.
精彩评论