本文介绍了比较时改变标记颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我想仅在比较结果点时更改标记颜色。在我的情况下,Probe1(TextBox值)与Probe1(参考文本框值)进行比较如果它们在绘图标记上不相等则应显示不同的颜色。
I want to change the marker color on comparison of the resultant point only.In my case Probe1 (TextBox value) compares with the Probe1 (Reference textbox value) and if they are not equal on plotting marker should display on different color.
Probe1(0)<> RefProbe1(0)然后系列3的Markercolor应该是RED
Probe1(0) <> RefProbe1(0) then Markercolor of series 3 should be RED
推荐答案
感谢回复。这是代码我已经应用
Thanks for the Reply.Here is the code i have applied
dim test as integer = Chart1.Series("Series1").Points.AddXY(Val(TextBox1.Text), Val(TextBox2.Text))
If Val(TextBox5.Text) > 21 Then
Dim i As Integer = CInt(Val(TextBox8.Text))
For Each pt As DataPoint In Chart1.Series("Series1").Points
Dim sev As String = TextBox2.Text
' this will be your value depending upon which you could set the color
Select Case sev
Case TextBoxList(i).Text
Chart1.Series("Series1").Points(test).MarkerColor = Color.Red
'Exit Select
Case Else
Chart1.Series("Series1").Points(test).MarkerColor = Color.Yellow
Chart1.Series("Series1").Points(test).MarkerBorderColor = Color.Yellow
End Select
Next
这篇关于比较时改变标记颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!