0

Does anyone know how to hide zero values when using LineItem (zedgraph)?

The code below shows my intention. I tried hide zero values of list2.

double x, y1, y2;
PointPairList list1 = new PointPairList();
PointPairList list2 = new PointPairList();
for (int i = 0; i < data.GetLength(0); i++)
{
    x = (double)i;
    y1 = data[i, 0];
    y2 = data[i, 1];
    list1.Add(x, y1);

    if (y2 < 2)
    {
        list2.Add(x,0);
    }
    else
    {
        list2.Add(x, y2);
    }
}

LineItem myCurve = myPane.AddCurve("N", list1, Color.Red, SymbolType.Default);
myCurve.Symbol.Size = 2;

LineItem myCurve2 = myPane.AddCurve("P", list2, Color.Blue, SymbolType.Default);
myCurve2.Line.IsVisible = false;
myCurve2.Symbol.Size = 1;
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
Byron
  • 1
  • 1
  • Byron, try running through your data set and change all values of 0 to null. For additional info, see this question: http://stackoverflow.com/questions/6603151/plotting-data-with-gaps-in-zedgraph-using-nullable-types-null-values – JYelton Dec 05 '11 at 03:51
  • you cant hide zeros inside the zedgraph method, you can only find them before adding them to your List's – Moonlight Dec 12 '11 at 08:14

0 Answers0