Profile Picture

Find series from af NAxis

Posted By Hans Henrik Friis Pedersen... 9 Years Ago
Author
Message
Hans Henrik Friis Pedersen...
Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 28, Visits: 136
Hi,

I assign a series to a NAxis like this:


NLineSeries line = (NLineSeries)_chartControl.Charts[0].Series.Add(SeriesType.Line);
line.UseXValues = true;
line.XValues.AddRange(this._data.Where(a => a.KKS_Key == kkskkey).Select(x => x.dateAndTime).ToList());
line.Values.AddRange(lst); line1.DisplayOnAxis(this._leftYAxis1.AxisId, true);


How do I find the NLineSeries from the _leftYAxis1 another place in the code later ? I'm looking for something like:


NLineSeries line = (NLineSeries)_leftYAxis1.child(0);


Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Hans,

The axes don't store information on which series scale on them - you can get this information from the series themselves though. The following code shows how to get the first series that scales on a particular axis:

  private NSeriesBase GetSeriesOnAxis(int axisId)
  {
   NChart chart = nChartControl1.Charts[0];
   for (int i = 0; i < chart.Series.Count; i++)
   {
    NSeriesBase series = chart.Series[i];

    if (series.VerticalAxes.Contains<int>(axisId) ||
     series.HorizontalAxes.Contains<int>(axisId))
    {
     return series;
    }
   }

   return null;
  }

Hope this helps - let us know if you meet any problems.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic