This documentation is archived and is not being maintained.

Light Object

Visual Studio .NET 2003

Represents the light source illuminating a three-dimensional chart.




The following example sets the ambient light and edge lighting intensity for a chart. To try the example, draw an MSChart and two ComboBox controls on a form. Paste the code into the Form object's code module and run the project. Click the ComboBox controls to see the change of ambient light and edge intensity.

Private Sub Form_Load()
    ' Configure the chart. 
   With MSChart1
      .Title = "Hold down Control and mousedown on chart"
      .chartType = VtChChartType3dBar
      .Plot.Light.AmbientIntensity = 1   ' 100 % Intensity.
      .Plot.Light.EdgeIntensity = 0.5        ' 50 % Intensity.
      .Plot.Light.EdgeVisible = True
   End With
   'Configure ComboBoxe controls. 
   ConfigCombo Combo1
   ConfigCombo Combo2
End Sub

Private Sub ConfigCombo(cmb As ComboBox)
   ' Populate a combobox with values.
   Dim i As Single
   For i = 0 To 1 Step 0.1
      cmb.AddItem i
   Next i
   cmb.ListIndex = 0
End Sub

Private Sub Combo1_Click()
   MSChart1.Plot.Light.AmbientIntensity = Combo1.Text
End Sub

Private Sub Combo2_Click()
   MSChart1.Plot.Light.EdgeIntensity = Combo2.Text
End Sub

See Also

Properties, Methods, and Events | LightSource Object | LightSources Collection | Z Property