0

I have a BaseVals series acquired from sql by a linq query on my chart. I need to put tolerance boundaries on the chart also depending on this BaseVals series' Y points.

X points of these boundary series will remain same. I am using below code for querying

 int max1 = dataContext.SupplierVals
            .Where(m => m.MouldID == mouldId && m.Plane == plane)
            .Max(m => m.MeasId);

 var query = dataContext.SupplierVals
             .Where(m => m.MouldID == mouldId 
             && m.MeasId == max1).ToList();

 if (cbBenchType.SelectedIndex == 0)
    {chartBench.Series["BaseVals"].Points.DataBind(query, "Distnc", "Apert", null);
     }

How can i add 2 series (y points of the series "BaseVals" + 0.1) and (y points of the series "BaseVals" - 0.1)?

Teo Laferla
  • 41
  • 1
  • 7
  • I don't know of an elegant solution. So you may have to create two more lists with the offsets you need. – TaW Sep 04 '19 at 07:12
  • @TaW i hoping you would come and save me, honestly :). How can i create such list? Or manipulate it? Any suggestions? – Teo Laferla Sep 04 '19 at 07:22
  • use linq skip and take methods https://stackoverflow.com/a/15386334/8879898 – Mohamed Sep 04 '19 at 07:25
  • 1
    You could use the BindXY overload that takes two enumerables and combine the x-values from the original query with a modified list of values: `var upper = query .Select(x => x.Apert + 0.1).ToList();` (not sure about your names) and then bind like so: `yourUpperSeries.Points.DataBindXY(query , "Distn", upper, "Apert");` – TaW Sep 04 '19 at 07:43
  • @Taw thank you. Another life saved! – Teo Laferla Sep 04 '19 at 08:05

0 Answers0