在下面的代码片段中,我试图比较两个数据点,因为我试图将饼图数据集中的所有低值点放入“其他”数据点。
我在这段代码行上找到了“无法将操作符<>”应用于System ..... DataPoint和System ..... DataPoint类型的操作数“如果pointValue< = minValue AndAlso Me.series .Points(index)<> colectedDataPoint“
Dim collectedValue As Double = 0.0
For index As Integer = 0 To Me.series.Points.Count - 1
Dim pointValue As Double = Math.Abs(Me.series.Points(index).YValues(0))
If pointValue <= minValue AndAlso Me.series.Points(index) <> colectedDataPoint Then
' Add point value to the collected value
collectedValue += pointValue
' Add point to supplemental series
Me.supplementalSeries.Points.Add(Me.series.Points(index).Clone())
' Remove point from the series
Me.series.Points.RemoveAt(index)
index -= 1
End If
Next
但是如果我在C#中编写相同的循环,那么等效的行就可以了; this.series.Points [index]!= colectedDataPoint
任何人都有解决方案,因为整个项目是用vb.net编写的,我宁愿保持统一。