📄 constantlines & stripes.frm
字号:
VERSION 5.00
Object = "{8996B0A4-D7BE-101B-8650-00AA003A5593}#4.0#0"; "Cfx4032.ocx"
Begin VB.Form Form1
Caption = "Chart FX. constant lines and color stripes"
ClientHeight = 5025
ClientLeft = 60
ClientTop = 345
ClientWidth = 9825
LinkTopic = "Form1"
ScaleHeight = 5025
ScaleWidth = 9825
StartUpPosition = 3 'Windows Default
Begin ChartFXLibCtl.ChartFX ChartFX1
Height = 4695
Left = 120
TabIndex = 2
Top = 120
Width = 7695
_cx = 2011042776
_cy = 2011042776
_Version = 262144
TypeMask = 109577224
MarkerShape = 0
BorderWidth = 2
BorderColor = 16777217
nPts = 12
nSer = 1
NumPoint = 12
NumSer = 1
End
Begin VB.CommandButton Command2
Caption = "Add Stripes"
Height = 375
Left = 8040
TabIndex = 1
Top = 4440
Width = 1695
End
Begin VB.CommandButton Command1
Caption = "Add Constant Lines"
Height = 375
Left = 8040
TabIndex = 0
Top = 3960
Width = 1695
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
'create 3 constant lines
ChartFX1.OpenDataEx COD_CONSTANTS, 3, 0
With ChartFX1.ConstantLine(0)
.Value = 70
.Axis = AXIS_Y 'horizontal
.Label = "Average 2"
'set the label of the constant line to be aligned to the right
.Style = .Style Or CC_RIGHTALIGNED
.LineColor = RGB(255, 0, 0)
.LineStyle = CHART_DASH
.LineWidth = 2
End With
With ChartFX1.ConstantLine(1)
.Value = 30
.Axis = AXIS_Y 'horizontal
.Label = "Average 1"
'set the label of the constant line to be aligned to the right
.Style = .Style Or CC_RIGHTALIGNED
.LineColor = RGB(255, 0, 0)
.LineStyle = CHART_DASH
.LineWidth = 2
End With
With ChartFX1.ConstantLine(2)
.Value = 5
.Axis = AXIS_X 'vertical
.Label = "Check point"
.LineColor = RGB(0, 0, 255)
.LineStyle = CHART_DOT
.LineWidth = 1
End With
ChartFX1.CloseData COD_CONSTANTS
'assign font properties for the text labels of the constant lines
ChartFX1.Fonts(CHART_FIXEDFT) = CF_BOLD Or CF_ARIAL Or 12
'assign text color for the labels of the constant lines
ChartFX1.RGBFont(CHART_FIXEDFT) = RGB(0, 128, 128)
End Sub
Private Sub Command2_Click()
ChartFX1.OpenDataEx COD_STRIPES, 3, 0
With ChartFX1.Stripe(0)
.Axis = AXIS_Y
.From = 10
.To = 30
.Color = CHART_PALETTECOLOR Or 2
End With
With ChartFX1.Stripe(1)
.Axis = AXIS_Y
.From = 40
.To = 50
.Color = CHART_PALETTECOLOR Or 19
End With
With ChartFX1.Stripe(2)
.Axis = AXIS_Y
.From = 60
.To = 90
.Color = CHART_PALETTECOLOR Or 41
End With
ChartFX1.CloseData COD_STRIPES
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -