ecGraph3D  -  Demo3

The VB code used to generate the above graph...

Public Sub Demo3(ecGraph3D1 As ecGraph3D)
  'Sparsely populated, custom font, custom z0 base color.
  Const Rows = 8, Cols = 8
  Dim zData(Rows, Cols) As Single
  Dim i As Integer, j As Integer
  With ecGraph3D1
    Call .Reset 'always start with "Reset"
    Call .AddText("Demo 3. Sparsely populated, custom font, custom z0 base color.", 2, 2, vbRed, "Arial|bold|11")
    
    'set range and colors for the z-color table
    Call .ClearColorBands
    Call .AddColorBand(-4, ecMaroon, ecMaroon, "-4")
    Call .AddColorBand(0, ecMaroon, ecPink, "0")
    Call .AddColorBand(4, ecPink, ecMaroon, "4")
    
    For i = 1 To Rows
      For j = 1 To Cols
        zData(i, j) = 2 * (Sin(i / 2) + Sin(j / 2) - Rnd)
        If Rnd < 0.7 Then zData(i, j) = 0 'randomly set most of the values to zero
      Next j
    Next i
    
    Call .AddDataArray(Rows, 1, 4, Cols, 1, 4, zData, 0, ecGray)
    
    Call .Refresh 'always end with "Refresh"
  End With
End Sub
 


      Contents  (ecGraph3D.ocx)     Variables     Events     Properties     Functions     Subs

Copyright © 2008, Encore Consulting Pty Ltd