How to define > operator for Datapoint?

Does anyone know what is wrong with this code?
I am getting the error:
error C2676: binary '<' : 'System::Windows::Forms::DataVisualization::Charting::DataPoint ^' does not define this operator or a conversion to a type acceptable to the predefined operator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
private: System::Void checkBox1_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
		
		DataPoint^ maxValue; 
	    DataPoint^ minValue;
		DataPoint^ maxValue1;
		DataPoint^ minValue1;
		DataPoint^ maxValue2;
		DataPoint^ minValue2;
		DataPoint^ maxValue3;
		DataPoint^ minValue3;
		DataPoint^ maxValue4;
		DataPoint^ minValue4;
		DataPoint^ maxValue5;
		DataPoint^ minValue5;
		DataPoint^ maxValue6;
		DataPoint^ minValue6;

			if(checkBox1->CheckState == CheckState::Checked)
				 {
	 
				 maxValue1 = this->chart1->Series["Series1"]->Points->FindMaxByValue("Y1", 0);
				 minValue1 = this->chart1->Series["Series1"]->Points->FindMinByValue("Y1", 0);

				 maxValue2 = this->chart1->Series["Series2"]->Points->FindMaxByValue("Y1", 0);
				 minValue2 = this->chart1->Series["Series2"]->Points->FindMinByValue("Y1", 0);

				 maxValue3 = this->chart1->Series["Series3"]->Points->FindMaxByValue("Y1", 0);
				 minValue3 = this->chart1->Series["Series3"]->Points->FindMinByValue("Y1", 0);

				 maxValue4 = this->chart1->Series["Series4"]->Points->FindMaxByValue("Y1", 0);
				 minValue4 = this->chart1->Series["Series4"]->Points->FindMinByValue("Y1", 0);

				 maxValue5 = this->chart1->Series["Series5"]->Points->FindMaxByValue("Y1", 0);
				 minValue5 = this->chart1->Series["Series5"]->Points->FindMinByValue("Y1", 0);
				
				 maxValue6 = this->chart1->Series["Series6"]->Points->FindMaxByValue("Y1", 0);
				 minValue6 = this->chart1->Series["Series6"]->Points->FindMinByValue("Y1", 0);

 if(maxValue2 > maxValue1){
					maxValue1 = maxValue2;	//update maxValue with new maximum value
				 }
				 if(minValue2 < minValue1){
					minValue1 = minValue2;
				 }
				if(maxValue3 > maxValue2)
				 {
					maxValue3 = maxValue2;
					}
				if(minValue3 < minValue2)
				 {
					 minValue3 = minValue3;
				 }
				 if(maxValue4 > maxValue3)
				 {
					 maxValue4 = maxValue3;
				 }
				 if(minValue4 < minValue3)
				 {
					 minValue4 = minValue3;
				 }
				 if(maxValue5 > maxValue4)
				 {
					 maxValue5 = maxValue4;
				 }
				if(minValue5 < minValue4)
				 {
					 minValue5 = minValue4;
				 }
				if(maxValue6 > maxValue5)
				 {
					 maxValue6 = maxValue5;
				 }
				 if(minValue6 < minValue5)
				 {
					 minValue6 = minValue5;
				 }
				
 this->chart1->ChartAreas[0]->AxisY->Maximum = maxValue1->YValues[0];
				 this->chart1->ChartAreas[0]->AxisY->Minimum = minValue1->YValues[0];

				 this->chart1->ChartAreas[0]->AxisY->Maximum = maxValue2->YValues[0];
				 this->chart1->ChartAreas[0]->AxisY->Minimum = minValue2->YValues[0];

				 this->chart1->ChartAreas[0]->AxisY->Maximum = maxValue3->YValues[0];
				 this->chart1->ChartAreas[0]->AxisY->Minimum = minValue3->YValues[0];

				 this->chart1->ChartAreas[0]->AxisY->Maximum = maxValue4->YValues[0];
				 this->chart1->ChartAreas[0]->AxisY->Minimum = minValue4->YValues[0];

				 this->chart1->ChartAreas[0]->AxisY->Maximum = maxValue5->YValues[0];
				 this->chart1->ChartAreas[0]->AxisY->Minimum = minValue5->YValues[0];

				 this->chart1->ChartAreas[0]->AxisY->Maximum = maxValue6->YValues[0];
				 this->chart1->ChartAreas[0]->AxisY->Minimum = minValue6->YValues[0];

}
			else if(checkBox1->CheckState == CheckState::Unchecked)
				 {
this->chart1->ChartAreas[0]->AxisY->Minimum = Convert::ToDouble(textBox2->Text);
				 this->chart1->ChartAreas[0]->AxisY->Maximum = Convert::ToDouble(textBox1->Text);
				}
		 }
Last edited on
closed account (Dy7SLyTq)
you need to define the > operator for Datapoint^
how do I do that?
Can anyone help?
Topic archived. No new replies allowed.