home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{02B5E320-7292-11CF-93D5-0020AF99504A}#2.0#0"; "MSCHRT20.OCX"
- Object = "{FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#2.0#0"; "MSCOMCT2.OCX"
- Begin VB.Form frmGRAPHData
- Caption = "Chart Control - Basic Properties"
- ClientHeight = 7770
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 10560
- LinkTopic = "Form2"
- ScaleHeight = 7770
- ScaleWidth = 10560
- StartUpPosition = 3 'Windows Default
- Begin MSChartLib.MSChart MSChart1
- Height = 4770
- Left = 60
- OleObjectBlob = "GrCtrl.frx":0000
- TabIndex = 0
- Top = 60
- Width = 10380
- End
- Begin VB.OptionButton ChartType
- Caption = "2D X-Y"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 16
- Left = 8445
- TabIndex = 28
- Top = 7245
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "2D Pie"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 14
- Left = 8445
- TabIndex = 27
- Top = 6885
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "2D Combination"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 9
- Left = 8445
- TabIndex = 26
- Top = 6525
- Width = 1830
- End
- Begin VB.OptionButton ChartType
- Caption = "3D Combination"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 8
- Left = 8445
- TabIndex = 25
- Top = 6180
- Width = 1815
- End
- Begin VB.OptionButton ChartType
- Caption = "2D Step"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 7
- Left = 8445
- TabIndex = 24
- Top = 5820
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "3D Step"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 6
- Left = 8445
- TabIndex = 23
- Top = 5460
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "2D Area"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 5
- Left = 6720
- TabIndex = 22
- Top = 7245
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "3D Area"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 4
- Left = 6720
- TabIndex = 21
- Top = 6885
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "2D Line"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 3
- Left = 6720
- TabIndex = 20
- Top = 6525
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "3D Line"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 2
- Left = 6720
- TabIndex = 19
- Top = 6180
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "2D Bar"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 1
- Left = 6735
- TabIndex = 18
- Top = 5820
- Value = -1 'True
- Width = 1440
- End
- Begin VB.OptionButton ChartType
- Caption = "3D Bar"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Index = 0
- Left = 6720
- TabIndex = 17
- Top = 5460
- Width = 1440
- End
- Begin VB.Frame Frame3
- Caption = "3D Chart Appearance"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1665
- Left = 135
- TabIndex = 8
- Top = 5955
- Width = 6195
- Begin VB.CommandButton Command4
- Caption = "Add Light"
- Enabled = 0 'False
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 360
- Left = 4800
- TabIndex = 13
- Top = 1200
- Width = 1215
- End
- Begin VB.HScrollBar HScroll2
- Height = 255
- LargeChange = 10
- Left = 2340
- Max = 360
- TabIndex = 12
- Top = 1305
- Width = 2235
- End
- Begin VB.HScrollBar HScroll1
- Height = 255
- LargeChange = 10
- Left = 2340
- Max = 360
- TabIndex = 11
- Top = 630
- Width = 2235
- End
- Begin VB.CheckBox Check1
- Caption = "Visible Edges"
- Enabled = 0 'False
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 210
- TabIndex = 9
- Top = 1215
- Width = 1740
- End
- Begin ComCtl2.UpDown UpDown1
- Height = 330
- Left = 1800
- TabIndex = 10
- Top = 510
- Width = 240
- _ExtentX = 423
- _ExtentY = 582
- _Version = 393216
- Enabled = 0 'False
- End
- Begin VB.Label Label2
- Caption = "Rotate Horizontally"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 2340
- TabIndex = 16
- Top = 1080
- Width = 1845
- End
- Begin VB.Label Label1
- Caption = "Rotate Horizontally"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 2340
- TabIndex = 15
- Top = 390
- Width = 1845
- End
- Begin VB.Label Label3
- Caption = "Ambient Light 0"
- Enabled = 0 'False
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 270
- Left = 180
- TabIndex = 14
- Top = 555
- Width = 1650
- End
- End
- Begin VB.Frame Frame2
- Caption = "Data Count"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 840
- Left = 135
- TabIndex = 2
- Top = 4995
- Width = 6165
- Begin VB.CheckBox Check2
- Caption = "Data In Rows"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 180
- TabIndex = 4
- Top = 375
- Width = 1680
- End
- Begin ComCtl2.UpDown UpDown2
- Height = 345
- Left = 3525
- TabIndex = 3
- Top = 345
- Width = 240
- _ExtentX = 423
- _ExtentY = 609
- _Version = 393216
- Value = 12
- Max = 12
- Min = 1
- Enabled = -1 'True
- End
- Begin ComCtl2.UpDown UpDown3
- Height = 345
- Left = 5550
- TabIndex = 5
- Top = 345
- Width = 240
- _ExtentX = 423
- _ExtentY = 609
- _Version = 393216
- Value = 3
- Min = 1
- Enabled = -1 'True
- End
- Begin VB.Label Label4
- Caption = "Rows: 12"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 2265
- TabIndex = 7
- Top = 375
- Width = 1215
- End
- Begin VB.Label Label5
- Caption = "Columns: 3"
- BeginProperty Font
- Name = "Verdana"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 4275
- TabIndex = 6
- Top = 375
- Width = 1215
- End
- End
- Begin VB.Frame Frame1
- Caption = "Chart Type "
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 2625
- Left = 6585
- TabIndex = 1
- Top = 4995
- Width = 3900
- End
- Attribute VB_Name = "frmGRAPHData"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' ******************************
- ' ******************************
- ' ** MASTERING VB6 **
- ' ** by Evangelos Petroutos **
- ' ** SYBEX, 1998 **
- ' ******************************
- ' ******************************
- Private Sub ChartType_Click(Index As Integer)
- ' Change the chart's type and enable/disable certain controls on the Form
- ' according to whether the chart is 2D or 3D (can't rotate 2 2D chart, for example)
- If Left(ChartType(Index).Caption, 2) = "2D" Then
- Label3.Enabled = False
- UpDown1.Enabled = False
- Check1.Enabled = False
- Command4.Enabled = False
- Else
- Label3.Enabled = True
- UpDown1.Enabled = True
- Check1.Enabled = True
- Command4.Enabled = True
- End If
- MSChart1.ChartType = Index
- End Sub
- Private Sub Check1_Click()
- ' Make edges visible
- MSChart1.Plot.Light.EdgeIntensity = Check1.Value
- End Sub
- Private Sub Check2_Click()
- ' Swap the order of data sets and data points
- ' by setting the DataSeriesInRow property
- ' This will swap the labels and legends too
- If Check2.Value Then
- MSChart1.Plot.DataSeriesInRow = True
- Else
- MSChart1.Plot.DataSeriesInRow = False
- End If
- End Sub
- Private Sub Command4_Click()
- MSChart1.Plot.Light.LightSources(1).Set Rnd() * 10, Rnd() * 10, Rnd() * 10, Rnd()
- End Sub
- Private Sub Form_Load()
- DisplayLabels
- End Sub
- Private Sub HScroll1_Change()
- ' Adjust the viewing angle of 3D charts
- MSChart1.Plot.View3d.Set HScroll1.Value, HScroll2.Value
- End Sub
- Private Sub HScroll2_Change()
- ' Adjust the viewing angle of 3D charts
- MSChart1.Plot.View3d.Set HScroll1.Value, HScroll2.Value
- End Sub
- Private Sub MSChart1_SeriesSelected(Series As Integer, MouseFlags As Integer, Cancel As Integer)
- ' redClr = MSChart1.Plot.SeriesCollection(Series).Pen.VtColor.Red
- ' greenClr = MSChart1.Plot.SeriesCollection(Series).Pen.VtColor.Green
- ' blueClr = MSChart1.Plot.SeriesCollection(Series).Pen.VtColor.Blue
- ' Debug.Print "The selected series color is (" & redClr & ", " & greenClr & ", " & blueClr & ")"
- End Sub
- Private Sub UpDown1_Change()
- ' Adjust intensity of ambient light
- MSChart1.Plot.Light.EdgeVisible = True
- MSChart1.Plot.Light.AmbientIntensity = UpDown1.Value / 10
- If UpDown1.Value = 0 Then MSChart1.Plot.Light.EdgeVisible = False
- Label3.Caption = "Ambient Light " & UpDown1.Value
- End Sub
- Private Sub UpDown2_Change()
- ' change number of rows
- Label4.Caption = "Rows: " & UpDown2.Value
- MSChart1.RowCount = UpDown2.Value
- ' every time the number of rows/cols is changed the labels must be redisplayed
- DisplayLabels
- End Sub
- Private Sub UpDown3_Change()
- ' change number of columns
- Label5.Caption = "Columns: " & UpDown3.Value
- MSChart1.ColumnCount = UpDown3.Value
- ' every time the number of rows/cols is changed the labels must be redisplayed
- DisplayLabels
- End Sub
- Sub DisplayLabels()
- ' This subroutine displays the labels of the chart
- ' The following loop scans all columns and
- ' labels them as "1998", "19919" and "2000"
- For i = 1 To MSChart1.ColumnCount
- MSChart1.Column = i
- MSChart1.ColumnLabel = i + 1997
- Next
- ' then scans all rows and label each data value
- ' with the first 3 characters of the month's name
- ' The control can't label more than 12 data sets
- For i = 1 To MSChart1.RowCount
- MSChart1.Row = i
- MSChart1.RowLabel = Left(MonthName(i), 3)
- Next
- End Sub
-