1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
Private Sub Command1_Click()
' Change d'abord le type de graphique en un
' graphique 3D pour voir toutes les parties du tracé.
MSChart1.chartType = VtChChartType3dArea
' Colore en bleu clair en utilisant
' l'objet Plot.
With MSChart1.Plot.Backdrop
' Aucune couleur n'apparaît sauf si vous attribuez
' à la propriété Style la valeur VtFillStyleBrush.
.Fill.Style = VtFillStyleBrush
.Fill.Brush.FillColor.Set 100, 255, 200
' Ajoute une bordure.
.Frame.Style = VtFrameStyleThickInner
' Définit le style pour afficher un ombrage.
.Shadow.Style = VtShadowStyleDrop
End With
' Colore le mur du tracé jaune.
With MSChart1.Plot
' Choisit un style continu.
.Wall.Brush.Style = VtBrushStyleSolid
' Choisit la couleur jaune.
.Wall.Brush.FillColor.Set 255, 255, 0
End With
With MSChart1.Plot ' Colore le bleu de base du tracé.
.PlotBase.BaseHeight = 200
.PlotBase.Brush.Style = VtBrushStyleSolid
.PlotBase.Brush.FillColor.Set 0, 0, 255
End With
End Sub
Private Sub Form_Load()
' Configure un contrôle ComboBox nommé cmbScale.
With Combo1
.AddItem "Log"
.AddItem "Percent"
.AddItem "Linear"
.ListIndex = 0
End With
End Sub
Private Sub Combo1_Click()
' Le contrôle ComboBox a trois éléments : Log, Percent,
' et Linear (l'échelle par défaut).
Select Case Combo1.Text
Case "Log"
MSChart1.Plot.Axis(VtChAxisIdY) _
.AxisScale.Type = VtChScaleTypeLogarithmic
' Vous devez spécifier un LogBase à utiliser lors du
' changement de l'échelle en Log. N'importe quelle valeur
' comprise entre 2 et 200 peut être affectée à la base.
MSChart1.Plot.Axis(VtChAxisIdY).AxisScale _
.LogBase = 10
Case "Percent"
MSChart1.Plot.Axis(VtChAxisIdY).AxisScale _
.Type = VtChScaleTypePercent
' Choisissez pour PercentBasis l'un des six types.
' Pour accélérer les choses, un seul est illustré.
MSChart1.Plot.Axis(VtChAxisIdY).AxisScale _
.PercentBasis = VtChPercentAxisBasisMaxChart
Case "Linear"
MSChart1.Plot.Axis(VtChAxisIdY).AxisScale _
.Type = VtChScaleTypeLinear
End Select
End Sub |
Partager