home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Module1"
- Option Explicit
-
- Sub SetChartTypeAndSize(ch As Object, which%, rows%, cols%)
- '' Sets chart formatting attributes
-
- ch.ToDefaults
- ch.DataGrid.SetSize 1, 1, rows, cols
- ch.ChartType = which
- ch.Backdrop.Fill.Style = VtFillStyleBrush
- ch.Backdrop.Fill.Brush.FillColor.Set 64, 192, 192
-
- With ch.Plot
-
- .UniformAxis = False
- .Axis(VtChAxisIdY).ValueScale.Maximum = 1
- .Axis(VtChAxisIdY).ValueScale.Minimum = -1
- .Axis(VtChAxisIdY).ValueScale.MajorDivision = 2
-
- Select Case which
- Case VtChChartType2dXY
- .Axis(VtChAxisIdX).Labels.Item(1).Format = "0.00"
- .Axis(VtChAxisIdX).ValueScale.MajorDivision = 3
-
- Case VtChChartType3dLine
- .Axis(VtChAxisIdX).AxisScale.Hide = True
- .Axis(VtChAxisIdZ).AxisScale.Hide = True
-
- Case VtChChartType2dBar
- .Axis(VtChAxisIdX).AxisScale.Hide = True
-
- Case VtChChartType3dBar
-
- Case VtChChartType2dRadar
- .Axis(VtChAxisIdX).AxisScale.Hide = True
-
- Case VtChChartType2dPolar
-
- Case VtChChartType3dSurface
- .Elevation.ColorType = VtChContourColorTypeGradient
- .Elevation.AutoValues = False
- .Elevation.Surface.DisplayType = VtChSurfaceDisplayTypeCBands
- .PlotBase.BaseHeight = 0
-
- .Axis(VtChAxisIdX).Pen.Style = VtPenStyleNull
- .Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
- .Axis(VtChAxisIdX).AxisScale.Hide = True
-
- .Axis(VtChAxisIdY).Pen.Style = VtPenStyleNull
- .Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
- .Axis(VtChAxisIdY).AxisScale.Hide = True
-
- .Axis(VtChAxisIdY2).Pen.Style = VtPenStyleNull
- .Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
- .Axis(VtChAxisIdY2).AxisScale.Hide = True
-
- .Axis(VtChAxisIdZ).Pen.Style = VtPenStyleNull
- .Axis(VtChAxisIdZ).AxisGrid.MajorPen.Style = VtPenStyleNull
- .Axis(VtChAxisIdZ).AxisScale.Hide = True
-
- .Wall.Pen.Style = VtPenStyleNull
-
- Case Else
- MsgBox "Unsupported chart type requested in SetChartType."
- End Select
- End With
-
- End Sub
-
- Sub ZeroGrid(ch As Object)
-
- Dim i%, j%
-
- With ch.DataGrid
- For i = 1 To ch.RowCount
- For j = 1 To ch.ColumnCount
- .SetData i, j, 0, True
- Next j
- Next i
- End With
-
- End Sub
-
-