home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 October / DPPCPRO1098.ISO / Ocx / VCFIMP / VCIMPRES.Z / moving.bas < prev    next >
Encoding:
BASIC Source File  |  1995-11-01  |  2.6 KB  |  84 lines

  1. Attribute VB_Name = "Module1"
  2. Option Explicit
  3.  
  4. Sub SetChartTypeAndSize(ch As Object, which%, rows%, cols%)
  5. '' Sets chart formatting attributes
  6.  
  7.    ch.ToDefaults
  8.    ch.DataGrid.SetSize 1, 1, rows, cols
  9.    ch.ChartType = which
  10.    ch.Backdrop.Fill.Style = VtFillStyleBrush
  11.    ch.Backdrop.Fill.Brush.FillColor.Set 64, 192, 192
  12.    
  13.    With ch.Plot
  14.    
  15.       .UniformAxis = False
  16.       .Axis(VtChAxisIdY).ValueScale.Maximum = 1
  17.       .Axis(VtChAxisIdY).ValueScale.Minimum = -1
  18.       .Axis(VtChAxisIdY).ValueScale.MajorDivision = 2
  19.  
  20.       Select Case which
  21.          Case VtChChartType2dXY
  22.             .Axis(VtChAxisIdX).Labels.Item(1).Format = "0.00"
  23.             .Axis(VtChAxisIdX).ValueScale.MajorDivision = 3
  24.             
  25.          Case VtChChartType3dLine
  26.             .Axis(VtChAxisIdX).AxisScale.Hide = True
  27.             .Axis(VtChAxisIdZ).AxisScale.Hide = True
  28.             
  29.          Case VtChChartType2dBar
  30.             .Axis(VtChAxisIdX).AxisScale.Hide = True
  31.          
  32.          Case VtChChartType3dBar
  33.          
  34.          Case VtChChartType2dRadar
  35.             .Axis(VtChAxisIdX).AxisScale.Hide = True
  36.          
  37.          Case VtChChartType2dPolar
  38.          
  39.          Case VtChChartType3dSurface
  40.             .Elevation.ColorType = VtChContourColorTypeGradient
  41.             .Elevation.AutoValues = False
  42.             .Elevation.Surface.DisplayType = VtChSurfaceDisplayTypeCBands
  43.             .PlotBase.BaseHeight = 0
  44.             
  45.             .Axis(VtChAxisIdX).Pen.Style = VtPenStyleNull
  46.             .Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
  47.             .Axis(VtChAxisIdX).AxisScale.Hide = True
  48.             
  49.             .Axis(VtChAxisIdY).Pen.Style = VtPenStyleNull
  50.             .Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
  51.             .Axis(VtChAxisIdY).AxisScale.Hide = True
  52.             
  53.             .Axis(VtChAxisIdY2).Pen.Style = VtPenStyleNull
  54.             .Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
  55.             .Axis(VtChAxisIdY2).AxisScale.Hide = True
  56.             
  57.             .Axis(VtChAxisIdZ).Pen.Style = VtPenStyleNull
  58.             .Axis(VtChAxisIdZ).AxisGrid.MajorPen.Style = VtPenStyleNull
  59.             .Axis(VtChAxisIdZ).AxisScale.Hide = True
  60.             
  61.             .Wall.Pen.Style = VtPenStyleNull
  62.             
  63.          Case Else
  64.             MsgBox "Unsupported chart type requested in SetChartType."
  65.       End Select
  66.    End With
  67.    
  68. End Sub
  69.  
  70. Sub ZeroGrid(ch As Object)
  71.  
  72.    Dim i%, j%
  73.    
  74.    With ch.DataGrid
  75.       For i = 1 To ch.RowCount
  76.          For j = 1 To ch.ColumnCount
  77.             .SetData i, j, 0, True
  78.          Next j
  79.       Next i
  80.    End With
  81.    
  82. End Sub
  83.  
  84.