📄 xchart.vb
字号:
'UPGRADE_ISSUE: UserControl 属性 UserControl.ScaleMode 未升级。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"”
MyBase.ScaleMode = vbPixels
'setup the 4 points of the trapezio
sngXTemp = (sngX2 - sngX1) / 4 'consider the 25% as X-offset
'set the points anti-clockwise
' (1)-----(2)
' / \
' / \
' (0)-------------(3)
uaPts(0).X = sngX1 / VB6.TwipsPerPixelX
uaPts(1).X = (sngX1 + sngXTemp) / VB6.TwipsPerPixelX
uaPts(2).X = (sngX2 - sngXTemp) / VB6.TwipsPerPixelX
uaPts(3).X = sngX2 / VB6.TwipsPerPixelX
If dblData > 0 Then
uaPts(0).Y = sngY2 / VB6.TwipsPerPixelY
uaPts(1).Y = sngY1 / VB6.TwipsPerPixelY
uaPts(2).Y = sngY1 / VB6.TwipsPerPixelY
uaPts(3).Y = sngY2 / VB6.TwipsPerPixelY
Else
uaPts(0).Y = sngY1 / VB6.TwipsPerPixelY
uaPts(1).Y = sngY2 / VB6.TwipsPerPixelY
uaPts(2).Y = sngY2 / VB6.TwipsPerPixelY
uaPts(3).Y = sngY1 / VB6.TwipsPerPixelY
End If
' If uBarShadow = True Then
' lngFillColor = UserControl.FillColor
' UserControl.FillColor = uBarShadowColor
' lRet = Polygon(UserControl.hDC, uaPts(0), 4)
' UserControl.FillColor = lngFillColor
'resize the trapezio
' uaPts(1).X = uaPts(1).X - 2
' uaPts(2).X = uaPts(2).X - 2
' uaPts(3).X = uaPts(3).X - 2
' If dblData > 0 Then
' uaPts(1).Y = uaPts(1).Y + 2
' uaPts(2).Y = uaPts(2).Y + 2
' Else
' uaPts(1).Y = uaPts(1).Y - 2
' uaPts(2).Y = uaPts(2).Y - 2
' End If
' End If
'draw the filled trapezio
'UPGRADE_ISSUE: UserControl 属性 UserControl.hDC 未升级。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"”
lRet = Polygon(MyBase.hDC, uaPts(0), 4)
'reset the scalemode
'UPGRADE_ISSUE: UserControl 属性 UserControl.ScaleMode 未升级。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="CC4C7EC0-C903-48FC-ACCC-81861D12DA4A"”
MyBase.ScaleMode = intScaleMode
'free the memory
'UPGRADE_NOTE: Erase 已升级到 System.Array.Clear。 单击以获得更多信息:“ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"”
System.Array.Clear(uaPts, 0, uaPts.Length)
End Sub
Public WriteOnly Property ChartType() As ChartTypeConstants
Set(ByVal Value As ChartTypeConstants)
If Value <> uChartType Then
uChartType = Value
DrawChart()
RaiseEvent ChartTypeChange()
End If
End Set
End Property
Public Property HotTracking() As Boolean
Get
HotTracking = uHotTracking
End Get
Set(ByVal Value As Boolean)
If Value <> uHotTracking Then
uHotTracking = Value
DrawChart()
RaiseEvent HotTrackingChange()
End If
End Set
End Property
Public WriteOnly Property CustomMenuItems() As String
Set(ByVal Value As String) '55555
uCustomMenuItems = Value
FixCustomMenu()
RaiseEvent CustomMenuItemsChange()
End Set
End Property
Public Property MaxY() As Double
Get '5444444444
MaxY = uMaxYValue
End Get
Set(ByVal Value As Double)
If Value > uMinYValue Then
uMaxYValue = Value
DrawChart()
RaiseEvent MaxYChange()
End If
End Set
End Property
Public Property MinY() As Double
Get '535555555555
MinY = uMinYValue
End Get
Set(ByVal Value As Double)
If Value < uMaxYValue Then
uMinYValue = Value
DrawChart()
RaiseEvent MinYChange()
End If
End Set
End Property
Public Property AxisLabelXColor() As System.Drawing.Color
Get
AxisLabelXColor = System.Drawing.ColorTranslator.FromOle(uXAxisLabelColor)
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> uXAxisLabelColor Then
uXAxisLabelColor = System.Drawing.ColorTranslator.ToOle(Value)
DrawChart()
RaiseEvent AxisLabelXColorChange()
End If
End Set
End Property
Public Property AxisLabelYColor() As System.Drawing.Color
Get
AxisLabelYColor = System.Drawing.ColorTranslator.FromOle(uYAxisLabelColor)
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> uYAxisLabelColor Then
uYAxisLabelColor = System.Drawing.ColorTranslator.ToOle(Value)
DrawChart()
RaiseEvent AxisLabelYColorChange()
End If
End Set
End Property
Public Property AxisItemsYColor() As System.Drawing.Color
Get
AxisItemsYColor = System.Drawing.ColorTranslator.FromOle(uYAxisItemsColor)
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> uYAxisItemsColor Then
uYAxisItemsColor = System.Drawing.ColorTranslator.ToOle(Value)
DrawChart()
RaiseEvent AxisItemsYColorChange()
End If
End Set
End Property
Public Property AxisItemsXColor() As System.Drawing.Color
Get
AxisItemsXColor = System.Drawing.ColorTranslator.FromOle(uXAxisItemsColor)
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> uXAxisItemsColor Then
uXAxisItemsColor = System.Drawing.ColorTranslator.ToOle(Value)
DrawChart()
RaiseEvent AxisItemsXColorChange()
End If
End Set
End Property
Public Overrides Property BackColor() As System.Drawing.Color
Get
BackColor = MyBase.BackColor
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> System.Drawing.ColorTranslator.ToOle(MyBase.BackColor) Then
MyBase.BackColor = Value
DrawChart()
RaiseEvent BackColorChange()
End If
End Set
End Property
Public Property MajorGridColor() As System.Drawing.Color
Get
MajorGridColor = System.Drawing.ColorTranslator.FromOle(uMajorGridColor)
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> uMajorGridColor Then
uMajorGridColor = System.Drawing.ColorTranslator.ToOle(Value)
DrawChart()
RaiseEvent MajorGridColorChange()
End If
End Set
End Property
Public Property ChartTitleColor() As System.Drawing.Color
Get
ChartTitleColor = System.Drawing.ColorTranslator.FromOle(uChartTitleColor)
End Get
Set(ByVal Value As System.Drawing.Color)
If System.Drawing.ColorTranslator.ToOle(Value) <> uChartTitleColor Then
uChartTitleColor = System.Drawing.ColorTranslator.ToOle(Value)
DrawChart()
RaiseEvent ChartTitleColorChange()
End If
End Set
End Property
Public Property ChartSubTitleColor() As System.Drawing.Color
Get
ChartSubTitleColor = System.Drawing.ColorTranslator.FromOle(uChartSubTitleColor)
End Get
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -