How to miss points in a ZedGraph line graph in C#

2019-01-28 23:05发布

问题:

I have bit of code that draws nice line charts in ZedGraph.

I can not change the code entirely, but I would like to have some of the lines not have a y value for each point on the x-axis.

I can do this in Excel, but I don't know how to in ZedGraph. I create graph with .AddCurve.

How do I do this?

回答1:

NaN values should do the trick.

If you want to break the line for example between x=1 and x=2, just add a point (1.5, double.NaN). Zedgraph should make the gap by itself.