2

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
  • Do you just want to not add data-points, or do you want the lines to be noncontinuous (with breaks in between)? – Bobby Mar 01 '11 at 13:11
  • Bobby,no-continuous. so maybe a line has (1,1.2),(2,1.21),(3,1,22) and I want to plot (2,1.2105) but have no y values for x=1 or x=3. This obviously is super-simplified! – ManInMoon Mar 01 '11 at 13:53
  • 1
    @ManInMoon: "I have bit of code" - please add the code to the question using the `edit` link. Also, include an image of what your desired graph looks like (created in excel, possibly) – Justin Mar 01 '11 at 18:59
  • Justin - I tried to add an image but the browse... button doesn't do anything - am I doing something wrong? I expected it to bring up a file selection menu- I tried it many times. – ManInMoon Mar 02 '11 at 11:02

1 Answers1

3

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.

Gacek
  • 10,184
  • 9
  • 54
  • 87