How to miss points in a ZedGraph line graph in C#
Asked Answered
H

1

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?

Hydria answered 1/3, 2011 at 13:3 Comment(4)
Do you just want to not add data-points, or do you want the lines to be noncontinuous (with breaks in between)?Bristletail
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!Hydria
@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)Agueweed
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.Hydria
O
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.

Overawe answered 3/3, 2011 at 11:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.