📄 datab.frm
字号:
VERSION 5.00
Object = "{8996B0A4-D7BE-101B-8650-00AA003A5593}#4.0#0"; "CFX4032.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "Chart FX. Data-Aware Charts"
ClientHeight = 6045
ClientLeft = 2055
ClientTop = 1605
ClientWidth = 8115
LinkTopic = "Form1"
ScaleHeight = 6045
ScaleWidth = 8115
Begin MSAdodcLib.Adodc Data1
Height = 495
Left = 120
Top = 5520
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 873
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin ChartfxLibCtl.ChartFX ChartFX1
Bindings = "datab.frx":0000
Height = 5295
Left = 120
TabIndex = 0
Top = 120
Width = 7935
_cx = 149698220
_cy = 149693564
_Version = 262144
TypeMask = 109576454
LeftGap = 47
RGB2DBk = -2147483626
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 Form_Load()
'define data types for each field in the sales table
'label type will be taken as text for the x-axis labels
'each value type will be taken as series
'not used type will not be used as data for the chart
ChartFX1.DataType(0) = CDT_LABEL 'saledate
ChartFX1.DataType(1) = CDT_NOTUSED 'saleterm
ChartFX1.DataType(2) = CDT_VALUE 'total amount
ChartFX1.DataType(3) = CDT_NOTUSED 'total discount
ChartFX1.DataType(4) = CDT_VALUE 'total projected
ChartFX1.DataType(5) = CDT_NOTUSED 'prodid
' Read Database
Data1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & App.Path & "\CfxSamp.mdb"
Data1.RecordSource = "sales"
Data1.Refresh
'activate the data editor and the series legend box
ChartFX1.DataEditor = True
'set the chart type for both the series
ChartFX1.Gallery = AREA
'set the colors for both the series
ChartFX1.OpenDataEx COD_COLORS, 2, 0
ChartFX1.Series(0).Color = RGB(128, 128, 100)
ChartFX1.Series(1).Color = RGB(0, 128, 128)
ChartFX1.CloseData COD_COLORS
' Add titles
'set the chart top title and properties
ChartFX1.Title(CHART_TOPTIT) = "Sales Trend"
ChartFX1.RGBFont(CHART_TOPTIT) = RGB(0, 128, 128)
ChartFX1.Fonts(CHART_TOPTIT) = CF_TIMES Or CF_BOLD Or 12
'set the y-axis title and properties
With ChartFX1.Axis(AXIS_Y)
.Title = "Sales"
.TitleColor = RGB(0, 128, 128)
.TitleFont.Italic = True
.TitleFont.Name = "arial"
.TitleFont.Size = 12
.Format = AF_CURRENCY
End With
'set the x-axis title and properies
With ChartFX1.Axis(AXIS_X)
.Title = "Date-Period"
.TitleColor = RGB(0, 128, 128)
.TitleFont.Italic = True
.TitleFont.Name = "arial"
.TitleFont.Size = 12
End With
' Series legend box
ChartFX1.SerLegBox = True
'set some properties of the series legend box object
With ChartFX1.SerLegBoxObj
.BkColor = CHART_PALETTECOLOR Or 3
.BorderStyle = BBS_SUNKEN
.Font.Italic = True
.Font.Bold = True
.Font.Name = "Times New Roman"
.Font.Size = 12
.Docked = TGFP_TOP
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -