ms chart how do i compare datapoint yvalue
i am doing this:
foreach (DataPoint point in chart1.S开发者_JS百科eries[0].Points)
{
if (point.yvalue > mean*1.3) ...
....
}
i need to be able to compare every yvalue of every point to a double. how can i do this?
This depends if you have multiple Y Values per Point or not (depending on the chartArea type)
First Case : X/Y Values are bijective (1X Val <-> 1Y Val) (most frequent case):
foreach (DataPoint point in chart.Series[0].Points)
{
if (point.YValues[0] > myValueToCompareTo)
//Do My Stuff;
}
Second case : (1X Val -> NY Val) iterate over each Y Value for each point
foreach (DataPoint point in chart.Series[0].Points)
{
int j;
for (j = 0; j <point.YValues.Length; j++)
if (point.YValues[j] > myValueToCompareTo)
//Do My Stuff;
}
精彩评论