home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 October / DPPCPRO1098.ISO / Ocx / VCFIMP / VCIMPRES.Z / LotsO.txt < prev    next >
Encoding:
Text File  |  1995-11-01  |  116.1 KB  |  3,455 lines

  1. Attribute VB_Name = "FormatCode"
  2. Option Explicit
  3.  
  4. Sub AreaChart()
  5.  
  6.    Dim series As Object, i%
  7.    
  8.    Call DefaultChart
  9.    
  10.    With frmMain.vtchart1
  11.       Select Case AreaIndex
  12.          Case 0   ' 2D Area
  13.             .ChartType = VtChChartType2dArea
  14.             Call QReadData(App.Path + VAREADATA1)
  15.            
  16.          Case 1   ' Stacked Area
  17.             .ChartType = VtChChartType2dArea
  18.             Call QReadData(App.Path + VAREADATA1)
  19.             
  20.             ' Stack all series on top of series 1
  21.             With .Plot.SeriesCollection
  22.                For i = 2 To .Count
  23.                   With .Item(i).Position
  24.                      .Excluded = False
  25.                      .Hidden = False
  26.                      .Order = 1
  27.                      .StackOrder = i
  28.                   End With
  29.                Next i
  30.             End With
  31.             
  32.          Case 2   ' Smoothed Area
  33.             .ChartType = VtChChartType2dArea
  34.             Call QReadData(App.Path + VAREADATA2)
  35.             
  36.             For Each series In .Plot.SeriesCollection
  37.                series.SmoothingFactor = 10
  38.                series.SmoothingType = VtSmoothingTypeQuadraticBSpline
  39.             Next series
  40.    
  41.          Case 3   ' Guide Lines
  42.             .ChartType = VtChChartType2dArea
  43.             Call QReadData(App.Path + VAREADATA2)
  44.             
  45.             With .Plot.SeriesCollection.Item(1)
  46.                ' Turn on Guidelines
  47.                .ShowGuideLine(VtChAxisIdX) = True
  48.                
  49.                ' Set series guideline colors
  50.                .GuideLinePen.Width = 1
  51.                .GuideLinePen.VtColor.Set 192, 192, 50
  52.             End With
  53.             
  54.             '' OCX -- minor & major pens switched ???
  55.             .Plot.Axis(VtChAxisIdX).AxisGrid.MinorPen.Style = VtPenStyleNull
  56.             .Plot.Axis(VtChAxisIdY).AxisGrid.MinorPen.Style = VtPenStyleNull
  57.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MinorPen.Style = VtPenStyleNull
  58.             
  59.          Case 4  ' 3D Area
  60.             .ChartType = VtChChartType3dArea
  61.             Call QReadData(App.Path + VAREADATA1)
  62.             
  63.             ' Set the width for a more pleasing view
  64.             .Plot.WidthToHeightRatio = 2
  65.             .Plot.DepthToHeightRatio = 3
  66.             
  67.             ' Set rotation and elevation
  68.             .Plot.View3d.rotation = 42
  69.             .Plot.View3d.elevation = 3
  70.             
  71.             ' Turn the legend off
  72.             .Legend.Location.Visible = False
  73.             
  74.             ' Turn off X and Z axis
  75.             Call QSetAxisLabel(VtChAxisIdX, False, 14, 0, 0, 202)
  76.             Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  77.             
  78.             ' Make Y and Y2 axis larger
  79.             Call QSetAxisLabel(VtChAxisIdY, True, 14, 0, 0, 202)
  80.             Call QSetAxisLabel(VtChAxisIdY2, True, 14, 0, 0, 202)
  81.             
  82.          Case 5  ' 3D Labeled
  83.             .ChartType = VtChChartType3dArea
  84.             Call QReadData(App.Path + VAREADATA1)
  85.             
  86.             ' Set the width for a more pleasing view
  87.             .Plot.WidthToHeightRatio = 2
  88.             .Plot.DepthToHeightRatio = 3
  89.             
  90.             ' Set rotation and elevation
  91.             .Plot.View3d.rotation = 67
  92.             .Plot.View3d.elevation = 12
  93.             
  94.             ' Turn the legend off
  95.             .Legend.Location.Visible = False
  96.             
  97.             '' Set all data points at once
  98.             For Each series In .Plot.SeriesCollection
  99.                With series.DataPoints.Item(-1).DataPointLabel
  100.                   ' Turn point the labels on
  101.                   .LocationType = VtChLabelLocationTypeAbovePoint
  102.                   .Component = VtChLabelComponentValue
  103.                   .LineStyle = VtChLabelLineStyleNone
  104.                   .Custom = False
  105.             
  106.                   ' Make the labels larger and change color
  107.                   .VtFont.Size = 14
  108.                   .VtFont.VtColor.Set 0, 0, 255
  109.                End With
  110.             Next series
  111.             
  112.             ' Turn X, Y, Z axis off
  113.             Call QSetAxisLabel(VtChAxisIdX, False, 14, 0, 0, 202)
  114.             Call QSetAxisLabel(VtChAxisIdY, False, 14, 0, 0, 202)
  115.             Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  116.             
  117.             ' Turn Y2 axis on
  118.             Call QSetAxisLabel(VtChAxisIdY2, True, 14, 0, 0, 202)
  119.             
  120.          Case 6  ' 3D Wide Area
  121.             .ChartType = VtChChartType3dArea
  122.             Call QReadData(App.Path + VAREADATA1)
  123.             
  124.             ' Set the width for a more pleasing view
  125.             .Plot.WidthToHeightRatio = 2
  126.             .Plot.DepthToHeightRatio = 10
  127.             
  128.             ' Turn the legend off
  129.             .Legend.Location.Visible = False
  130.             
  131.          Case 7  ' 3D Smoothed Area
  132.             .ChartType = VtChChartType3dArea
  133.             Call QReadData(App.Path + VAREADATA2)
  134.             
  135.             ' Set the width for a more pleasing view
  136.             .Plot.WidthToHeightRatio = 2
  137.             .Plot.DepthToHeightRatio = 3
  138.             
  139.             ' Set rotation and elevation
  140.             .Plot.View3d.rotation = 46
  141.             .Plot.View3d.elevation = 0
  142.             
  143.             ' Turn the legend off
  144.             .Legend.Location.Visible = False
  145.             
  146.             ' Smooth the areas
  147.             For Each series In .Plot.SeriesCollection
  148.                series.SmoothingFactor = 10
  149.                series.SmoothingType = VtSmoothingTypeQuadraticBSpline
  150.             Next series
  151.             
  152.             ' Turn Z axis off
  153.             Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  154.             
  155.        End Select
  156.    End With
  157. End Sub
  158.  
  159.  
  160. Sub BubbleChart()
  161.  
  162.    Dim series As Object
  163.    
  164.    Call DefaultChart
  165.    
  166.    With frmMain.vtchart1
  167.       .ChartType = VtChChartType2dBubble
  168.       
  169.       Select Case BubbleIndex
  170.          Case 0 ' Bubble
  171.             Call QReadData(App.Path + BUBBLEDATA1)
  172.             .Plot.MaxBubbleToAxisRatio = 0.2
  173.             .Plot.UniformAxis = False
  174.                 
  175.          Case 1 ' Bubble Ratio
  176.             Call QReadData(App.Path + BUBBLEDATA1)
  177.             .Plot.MaxBubbleToAxisRatio = 0.4
  178.             .Plot.UniformAxis = False
  179.             
  180.          Case 2 ' Bubble Labels
  181.             Call QReadData(App.Path + BUBBLEDATA1)
  182.             .Plot.MaxBubbleToAxisRatio = 0.2
  183.             
  184.             For Each series In .Plot.SeriesCollection
  185.                With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).DataPointLabel
  186.                   .LocationType = VtChLabelLocationTypeCenter
  187.                   .Component = VtChLabelComponentValue
  188.                   .LineStyle = VtChLabelLineStyleNone
  189.                   .Custom = False
  190.                   .VtFont.Size = 12
  191.                   .VtFont.VtColor.Set 0, 0, 0
  192.                End With
  193.             Next series
  194.             
  195.             .Plot.UniformAxis = False
  196.       
  197.       End Select
  198.    End With
  199. End Sub
  200.  
  201. Sub ComboChart()
  202.    Dim i%
  203.    
  204.    ' Reset all chart options
  205.    Call DefaultChart
  206.  
  207.    With frmMain.vtchart1
  208.    
  209.    Select Case ComboIndex
  210.  
  211.       Case 0   'Line/Bar
  212.          Call QReadData(App.Path + COMBODATA1)
  213.          .ChartType = VtChChartType2dCombination
  214.          .Plot.SeriesCollection.Item(1).seriesType = VtChSeriesType2dLine
  215.          .Plot.SeriesCollection.Item(2).seriesType = VtChSeriesType2dBar
  216.  
  217.       Case 1   ' Bar/Line/Hi-Low
  218.          Call QReadData(App.Path + COMBODATA9)
  219.          .ChartType = VtChChartType2dHiLo
  220.  
  221.          ' First Series is the volume bar
  222.          .Plot.SeriesCollection.Item(1).seriesType = VtChSeriesType2dBar
  223.  
  224.          ' Second series is the trend line
  225.          .Plot.SeriesCollection.Item(2).seriesType = VtChSeriesType2dLine
  226.  
  227.          ' Series 3 through 6 are the OHLC columns
  228.          With .Plot.SeriesCollection
  229.             For i = 3 To .Count
  230.                ' Set to Open-Hi-Lo-Close
  231.                .Item(i).seriesType = VtChSeriesType2dOHLC
  232.                .Item(i).SeriesLabel.VtFont.VtColor.Set 0, 0, 0
  233.             Next i
  234.          End With
  235.  
  236.          ' Set Y1 axis for stock hi-low prices
  237.          With .Plot.Axis(VtChAxisIdY).ValueScale
  238.             .Auto = False
  239.             .Maximum = 35
  240.             .Minimum = 10
  241.             .MajorDivision = 5
  242.             .MinorDivision = 1
  243.          End With
  244.  
  245.          ' Turn on Y2 axis for volume
  246.          .Plot.SeriesCollection.Item(1).SecondaryAxis = True
  247.          With .Plot.Axis(VtChAxisIdY2).AxisScale
  248.             .Type = VtChScaleTypeLinear
  249.             .Hide = False
  250.             .LogBase = 10
  251.             .PercentBasis = VtChPercentAxisBasisMaxChart
  252.          End With
  253.  
  254.          ' Set Y2 Axis limits for stock volume
  255.          With .Plot.Axis(VtChAxisIdY2).ValueScale
  256.             .Auto = False
  257.             .Maximum = 4000
  258.             .Minimum = 0
  259.             .MajorDivision = 5
  260.             .MinorDivision = 1
  261.          End With
  262.         
  263.       Case 2   ' 3D Line/Bar
  264.          Call QReadData(App.Path + COMBODATA1)
  265.          .ChartType = VtChChartType3dCombination
  266.  
  267.          .Plot.SeriesCollection.Item(1).seriesType = VtChSeriesType3dLine
  268.          .Plot.SeriesCollection.Item(2).seriesType = VtChSeriesType3dBar
  269.     
  270.       Case 3   ' 3D Line/Bar/Area
  271.          Call QReadData(App.Path + COMBODATA3)
  272.          .Visible = False
  273.          .ChartType = VtChChartType3dCombination
  274.  
  275.          ' Set the width for a more pleasing view
  276.          .Plot.WidthToHeightRatio = 2
  277.          .Plot.DepthToHeightRatio = 2
  278.  
  279.          ' Make sure legend is off
  280.          .Legend.Location.Visible = False
  281.         
  282.          ' Set the title font
  283.          .Title.VtFont.Size = 16
  284.          .Title.VtFont.VtColor.Set 255, 255, 0
  285.  
  286.          ' Change each series type
  287.          .Plot.SeriesCollection.Item(1).seriesType = VtChSeriesType3dLine
  288.          .Plot.SeriesCollection.Item(2).seriesType = VtChSeriesType3dBar
  289.          .Plot.SeriesCollection.Item(3).seriesType = VtChSeriesType3dArea
  290.  
  291.          ' Set line to dashed line
  292.          With .Plot.SeriesCollection.Item(1).Pen
  293.             .Style = VtPenStyleDashed
  294.             .Join = VtPenJoinMiter
  295.             .Cap = VtPenCapButt
  296.             .Width = 8
  297.          End With
  298.  
  299.          ' Set bar shapes to cylinder
  300.          .Plot.SeriesCollection.Item(2).Bar.TopRatio = 1
  301.          .Plot.SeriesCollection.Item(2).Bar.Sides = 32
  302.  
  303.          ' Smooth the area
  304.          .Plot.SeriesCollection.Item(3).SmoothingFactor = 10
  305.          .Plot.SeriesCollection.Item(3).SmoothingType = VtSmoothingTypeQuadraticBSpline
  306.  
  307.          ' Change Series Colors
  308.          Call QSetSeriesColor(1, 77, 191, 64)  ' Greenish
  309.          Call QSetSeriesColor(i, 50, 163, 205) ' Blueish
  310.          Call QSetSeriesColor(i, 208, 47, 139) ' Redish
  311.  
  312.          ' Chart walls
  313.          .Plot.Wall.Width = 10
  314.          .Plot.Wall.Brush.Style = VtBrushStyleSolid
  315.  
  316.          .Visible = True
  317.  
  318.       Case 4   ' 3D Step/Area
  319.          Call QReadData(App.Path + COMBODATA4)
  320.          .Visible = False
  321.          .ChartType = VtChChartType3dCombination
  322.  
  323.          ' Set series types
  324.          .Plot.SeriesCollection.Item(1).seriesType = VtChSeriesType3dStep
  325.          .Plot.SeriesCollection.Item(2).seriesType = VtChSeriesType3dArea
  326.  
  327.          ' Set the width for a more pleasing view
  328.          .Plot.WidthToHeightRatio = 2
  329.  
  330.          ' Smooth the area
  331.          .Plot.SeriesCollection.Item(2).SmoothingFactor = 10
  332.          .Plot.SeriesCollection.Item(2).SmoothingType = VtSmoothingTypeQuadraticBSpline
  333.  
  334.          ' Turn off Z axis
  335.          Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  336.          .Visible = True
  337.       End Select
  338.    End With
  339. End Sub
  340.  
  341. Sub DefaultChart()
  342.  
  343.    Dim theRow%, theCol%
  344.  
  345. Screen.MousePointer = 11 ' Hourglass
  346.  
  347. With frmMain.vtchart1
  348.       ' Reset everything to defaults
  349.       .ToDefaults
  350.  
  351.       ' Put the chart in a defined state
  352.       .ChartType = VtChChartType2dBar
  353.       
  354.       ' ----- Set default data -----
  355.       
  356.       ' Set the number of rows and columns
  357.       .rowCount = 2
  358.       .ColumnCount = 2
  359.       
  360.       ' Set Column Labels
  361.       .Column = 1
  362.       .ColumnLabel = "Col 1"
  363.       .Column = 2
  364.       .ColumnLabel = "Col 2"
  365.       
  366.       ' Set Row Labels
  367.       .Row = 1
  368.       .RowLabel = "Row 1"
  369.       .Row = 2
  370.       .RowLabel = "Row 2"
  371.       
  372.       ' Set Data Points
  373.       For theRow = 1 To 2
  374.          .Row = theRow
  375.          For theCol = 1 To 2
  376.              .Column = theCol
  377.              .Data = ((theCol - 1) * 2) + theRow
  378.          Next theCol
  379.       Next theRow
  380.       
  381.       ' ----- Set up the Title -----
  382.       With .Title
  383.          ' Set the new title
  384.          .Text = "Default Chart"
  385.       
  386.          ' Set the title font
  387.          .VtFont.Size = 16
  388.          .VtFont.VtColor.Set 0, 0, 255
  389.       
  390.          ' Set title backdrop
  391.          .Backdrop.Fill.VtPicture.filename = ""
  392.          .Backdrop.Fill.Style = VtFillStyleNull
  393.          .Backdrop.Frame.Style = VtFrameStyleNull
  394.       
  395.          ' Set title location and make it visible
  396.          .Location.LocationType = VtChLocationTypeTop
  397.          .Location.Visible = True
  398.       End With
  399.       
  400.       ' ----- Set up legend -----
  401.       With .Legend
  402.          ' Set the legend font
  403.          .VtFont.Size = 12
  404.          .VtFont.VtColor.Set 255, 0, 0
  405.       
  406.          ' Put a frame on the Legend
  407.          .Backdrop.Frame.Style = VtFrameStyleSingleLine
  408.          .Backdrop.Fill.VtPicture.filename = ""
  409.       
  410.          ' Position the legend
  411.          .Location.LocationType = VtChLocationTypeRight
  412.          .Location.Visible = True
  413.       End With
  414.       
  415.       ' ----- Set up Chart Backdrop -----
  416.       ' Set the chart background to Gray
  417.       With .Backdrop
  418.          .Frame.Style = VtFrameStyleSingleLine
  419.          With .Fill
  420.             .VtPicture.filename = ""
  421.             .Style = VtFillStyleBrush
  422.             .Brush.Style = VtBrushStyleSolid
  423.             .Brush.FillColor.Set 192, 192, 192 'gray
  424.          End With
  425.       End With
  426.       
  427.       ' ----- Set up Plot Backdrop -----
  428.       ' Single line frame
  429.       .Plot.Backdrop.Frame.Style = VtFrameStyleSingleLine
  430.       
  431.       ' Add Shadow
  432.       With .Plot.Backdrop.Shadow
  433.          .Style = VtShadowStyleDrop
  434.          .Brush.Style = VtBrushStyleSolid
  435.          .Brush.FillColor.Set 0, 0, 0
  436.          .Offset.Set 2.5, 2.5
  437.       End With
  438.       
  439.       ' Backdrop color is Gray
  440.       With .Plot.Backdrop.Fill
  441.          .VtPicture.filename = ""
  442.          .Style = VtFillStyleBrush
  443.          .Brush.Style = VtBrushStyleSolid
  444.          .Brush.FillColor.Set 192, 192, 192
  445.       End With
  446.       
  447.       ' ----- Set the perspective, elevation and rotation -----
  448.       Call QSet3DView(60, 30)
  449.       
  450.       ' Set Perspective
  451.       .Plot.Perspective.Set 0.5, 0.5, 2
  452.  
  453.    End With
  454.    
  455.    Screen.MousePointer = 0
  456.    
  457. End Sub
  458.  
  459.  
  460. Sub DoughnutChart()
  461.  
  462.    Dim series As Object, i%
  463.  
  464.    Call DefaultChart
  465.  
  466.    ' Make X axis fonts larger (X axis is same as individual donut label)
  467.    Call QSetAxisLabel(VtChAxisIdX, True, 12, 0, 0, 255)
  468.    
  469.    With frmMain.vtchart1
  470.    
  471.    Select Case DoughnutIndex
  472.  
  473.       Case 0 ' Doughnut
  474.          Call QReadData(App.Path + PIEDATA1)
  475.          .ChartType = VtChChartType3dDoughnut
  476.  
  477.       Case 1 ' Multiple Doughnuts
  478.          Call QReadData(App.Path + PIEDATA2)
  479.          .ChartType = VtChChartType3dDoughnut
  480.  
  481.       Case 2 ' Exploded Pieces
  482.          Call QReadData(App.Path + PIEDATA1)
  483.          .ChartType = VtChChartType3dDoughnut
  484.          
  485.          ' Explode the pieces
  486.          For Each series In .Plot.SeriesCollection
  487.              series.DataPoints.Item(1).Offset = 0.1
  488.          Next series
  489.  
  490.       Case 3 ' Labels
  491.          Call QReadData(App.Path + PIEDATA1)
  492.          .ChartType = VtChChartType3dDoughnut
  493.          
  494.          For Each series In .Plot.SeriesCollection
  495.             With series.DataPoints.Item(-1).DataPointLabel
  496.                .VtFont.Size = 10
  497.                .VtFont.VtColor.Set 0, 0, 255
  498.                .LocationType = VtChLabelLocationTypeOutside
  499.                .Component = VtChLabelComponentValue
  500.                .LineStyle = VtChLabelLineStyleBent
  501.                .Custom = False
  502.             End With
  503.          Next series
  504.         
  505.       Case 4 ' Weighting
  506.          Call QReadData(App.Path + PIEDATA3)
  507.          .ChartType = VtChChartType3dDoughnut
  508.  
  509.          ' Turn on weighting
  510.          .Plot.Weighting.Basis = VtChPieWeightBasisTotal
  511.          .Plot.Weighting.Style = VtChPieWeightStyleDiameter
  512.  
  513.       Case 5 ' Interior Ratio
  514.          Call QReadData(App.Path + PIEDATA1)
  515.          .ChartType = VtChChartType3dDoughnut
  516.             
  517.          ' Change Radius
  518.          .Plot.Doughnut.Sides = 4
  519.          .Plot.Doughnut.InteriorRatio = 0.3
  520.  
  521.       Case 6 ' Thickness
  522.          Call QReadData(App.Path + PIEDATA1)
  523.          .ChartType = VtChChartType3dDoughnut
  524.             
  525.          ' Change the thickness
  526.          .Plot.Pie.ThicknessRatio = 0.66
  527.          .Plot.Pie.TopRadiusRatio = 1
  528.         
  529.       Case 7 ' Shapes
  530.          Call QReadData(App.Path + PIEDATA1)
  531.          .ChartType = VtChChartType3dDoughnut
  532.             
  533.          ' Change Number of sides
  534.          .Plot.Doughnut.Sides = 5
  535.          .Plot.Doughnut.InteriorRatio = 0.5
  536.             
  537.          ' Change the thickness
  538.          .Plot.Pie.ThicknessRatio = 0.5
  539.          .Plot.Pie.TopRadiusRatio = 1
  540.  
  541.       Case 8 ' Round
  542.          Call QReadData(App.Path + PIEDATA1)
  543.          .ChartType = VtChChartType3dDoughnut
  544.             
  545.          ' Change number of sides
  546.          .Plot.Doughnut.Sides = 60
  547.          .Plot.Doughnut.InteriorRatio = 0.5
  548.             
  549.          ' Change the thickness
  550.          .Plot.Pie.ThicknessRatio = 0.5
  551.          .Plot.Pie.TopRadiusRatio = 1
  552.             
  553.          ' Turn the edge pen off so they look nice
  554.          .Plot.light.EdgeVisible = False
  555.  
  556.       End Select
  557.    End With
  558. End Sub
  559.  
  560. Sub GanttChart()
  561.  
  562.    Dim dataPoint As Object
  563.    
  564.    ' Reset all chart options
  565.    Call DefaultChart
  566.       
  567.    With frmMain.vtchart1
  568.    
  569.       ' Turn the legend off
  570.       .Legend.Location.Visible = False
  571.       
  572.       Select Case GanttIndex
  573.       
  574.          Case 0   '2D Gantt
  575.             Call QReadData(App.Path + GANTT1)
  576.             .ChartType = VtChChartType2dGantt
  577.       
  578.             ' Set date axis options
  579.             With .Plot.Axis(VtChAxisIdY).DateScale
  580.                .Auto = False
  581.                .Maximum = 34606
  582.                .Minimum = 34547
  583.                .MajInt = VtChDateIntervalTypeWeekly
  584.                .MinInt = VtChDateIntervalTypeDaily
  585.                .MajFreq = 1
  586.                .MinFreq = 1
  587.                .SkipWeekend = True
  588.             End With
  589.       
  590.             'set axis label format
  591.             .Plot.Axis(VtChAxisIdY).Labels.Item(1).Format = "m/d"
  592.       
  593.             ' Set Axis Font
  594.             Call QSetAxisLabel(VtChAxisIdY, True, 8, 0, 0, 0)
  595.       
  596.       
  597.          Case 1   ' Labeled Gantt
  598.             .ChartType = VtChChartType2dGantt
  599.             Call QReadData(App.Path + GANTT1)
  600.       
  601.             'Set date axis options
  602.             With .Plot.Axis(VtChAxisIdY).DateScale
  603.                .Auto = False
  604.                .Maximum = 34606
  605.                .Minimum = 34547
  606.                .MajInt = VtChDateIntervalTypeWeekly
  607.                .MinInt = VtChDateIntervalTypeDaily
  608.                .MajFreq = 1
  609.                .MinFreq = 1
  610.                .SkipWeekend = True
  611.             End With
  612.       
  613.             'set axis label format
  614.             .Plot.Axis(VtChAxisIdY).Labels.Item(1).Format = "m/d"
  615.       
  616.             ' Set Axis Font
  617.             Call QSetAxisLabel(VtChAxisIdY, True, 8, 0, 0, 0)
  618.             
  619.             For Each dataPoint In .Plot.SeriesCollection.Item(1).DataPoints
  620.                With dataPoint.DataPointLabel
  621.                   'Set label location and style
  622.                   .LocationType = VtChLabelLocationTypeBase
  623.                   .Component = VtChLabelComponentValue
  624.                   .LineStyle = VtChLabelLineStyleNone
  625.                   .Custom = False
  626.       
  627.                   'Make the labels larger and change color
  628.                   .VtFont.Size = 12
  629.                   .VtFont.VtColor.Set 0, 0, 255
  630.       
  631.                   .ValueFormat = "mmm-dd"
  632.                   .PercentFormat = ""
  633.                End With
  634.             Next dataPoint
  635.       
  636.          Case 2   ' Multiple series
  637.             .ChartType = VtChChartType2dGantt
  638.             Call QReadData(App.Path + GANTT3)
  639.       
  640.             ' Turn the legend on
  641.             .Legend.Location.LocationType = VtChLocationTypeRight
  642.             .Legend.Location.Visible = True
  643.       
  644.             .Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.VtColor.Set 160, 160, 160
  645.       
  646.             'set axis label formats
  647.             .Plot.Axis(VtChAxisIdY).Labels.Item(1).Format = "mmm"
  648.       
  649.             'set axis font
  650.             Call QSetAxisLabel(VtChAxisIdY, True, 8, 0, 0, 0)
  651.       
  652.          Case 3   ' Picture Bars -- doesn't quite work yet (problems with pictures)
  653.             Call QReadData(App.Path + GANTT1)
  654.             .ChartType = VtChChartType2dGantt
  655.       
  656.             'Set date axis options
  657.             With .Plot.Axis(VtChAxisIdY).DateScale
  658.                .Auto = False
  659.                .Maximum = 34606
  660.                .Minimum = 34547
  661.                .MajInt = VtChDateIntervalTypeWeekly
  662.                .MinInt = VtChDateIntervalTypeDaily
  663.                .MajFreq = 1
  664.                .MinFreq = 1
  665.                .SkipWeekend = True
  666.             End With
  667.       
  668.             'set axis label format
  669.             .Plot.Axis(VtChAxisIdY).Labels.Item(1).Format = "dd"
  670.             '.Plot.axis(VtChAxisIdY).Labels.Item(2).Format = "mmmm"
  671.       
  672.             ' Set Axis Font
  673.             Call QSetAxisLabel(VtChAxisIdY, True, 8, 0, 0, 0)
  674.       
  675.             ' Put pictures in bars
  676.             With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).VtPicture
  677.                .Type = VtPictureTypeBMP
  678.                .Map = VtPictureMapTypeFitted
  679.                .filename = App.Path & VTBMP1
  680.             End With
  681.       
  682.          Case 4   ' 3D Default
  683.             Call QReadData(App.Path + GANTT1)
  684.             .ChartType = VtChChartType3dGantt
  685.       
  686.             'Set date axis options
  687.             With .Plot.Axis(VtChAxisIdY).DateScale
  688.                .Auto = False
  689.                .Maximum = 34606
  690.                .Minimum = 34547
  691.                .MajInt = VtChDateIntervalTypeWeekly
  692.                .MinInt = VtChDateIntervalTypeDaily
  693.                .MajFreq = 1
  694.                .MinFreq = 1
  695.                .SkipWeekend = True
  696.             End With
  697.       
  698.             'set axis label format
  699.             .Plot.Axis(VtChAxisIdY).Labels.Item(1).Format = "m/d"
  700.       
  701.             ' Set Axis Font
  702.             Call QSetAxisLabel(VtChAxisIdY, True, 14, 0, 0, 0)
  703.       
  704.             ' Turn minor grids off
  705.             .Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
  706.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
  707.       
  708.             'Set the width for a more pleasing view
  709.             .Plot.WidthToHeightRatio = 0.3
  710.             .Plot.DepthToHeightRatio = 4
  711.       
  712.             ' Set the elevation and rotation
  713.             Call QSet3DView(4, 6)
  714.       
  715.             ' Set Projection to oblique
  716.             .Plot.Projection = VtProjectionTypeOblique
  717.       
  718.             ' Turn off all current lights
  719.             .Plot.light.LightSources.Remove (-1)
  720.             
  721.             ' Set the new light high center
  722.             .Plot.light.LightSources.Add 0, -1, 2, 1
  723.       
  724.          Case 5   ' 3D Labeled Gantt
  725.             Call QReadData(App.Path + GANTT1)
  726.             .ChartType = VtChChartType3dGantt
  727.       
  728.             'Set date axis options
  729.             With .Plot.Axis(VtChAxisIdY).DateScale
  730.                .Auto = False
  731.                .Maximum = 34606
  732.                .Minimum = 34547
  733.                .MajInt = VtChDateIntervalTypeWeekly
  734.                .MinInt = VtChDateIntervalTypeDaily
  735.                .MajFreq = 1
  736.                .MinFreq = 1
  737.                .SkipWeekend = True
  738.             End With
  739.       
  740.             'set axis label format
  741.             .Plot.Axis(VtChAxisIdY).Labels.Item(1).Format = "m/d"
  742.       
  743.             ' Set Axis Font
  744.             Call QSetAxisLabel(VtChAxisIdY, True, 14, 0, 0, 0)
  745.       
  746.             ' Turn axis grids off
  747.             .Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
  748.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
  749.       
  750.             .Plot.WidthToHeightRatio = 0.3
  751.             .Plot.DepthToHeightRatio = 4
  752.       
  753.             ' Set the elevation and rotation
  754.             Call QSet3DView(57, 21)
  755.       
  756.             With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).DataPointLabel
  757.                ' Set label format
  758.                .ValueFormat = "mmm-dd"
  759.                .PercentFormat = ""
  760.       
  761.                ' Label the Point
  762.                .LocationType = VtChLabelLocationTypeAbovePoint
  763.                .Component = VtChLabelComponentValue
  764.                .LineStyle = VtChLabelLineStyleNone
  765.                .Custom = False
  766.       
  767.                ' Make the labels larger and change color
  768.                .VtFont.Size = 12
  769.                .VtFont.VtColor.Set 0, 160, 240
  770.             End With
  771.       
  772.       End Select
  773.    End With
  774. End Sub
  775.  
  776. Sub HBarChart()
  777.    
  778.    Dim dataPoint As Object, series As Object, i%
  779.    
  780.    ' Reset all chart options
  781.    Call DefaultChart
  782.    
  783.    With frmMain.vtchart1
  784.    
  785.       Select Case HBarIndex
  786.       
  787.          Case 0   'Default Chart
  788.             Call QReadData(App.Path + HBARDATA20)
  789.             .ChartType = VtChChartType2dHorizontalBar
  790.       
  791.          Case 1   ' Labeled Bars
  792.             .ChartType = VtChChartType2dHorizontalBar
  793.             Call QReadData(App.Path + HBARDATA21)
  794.       
  795.             For Each dataPoint In .Plot.SeriesCollection.Item(1).DataPoints
  796.                With dataPoint.DataPointLabel
  797.                   ' Label the series
  798.                   .LocationType = VtChLabelLocationTypeBelowPoint
  799.                   .Component = VtChLabelComponentValue
  800.                   .LineStyle = VtChLabelLineStyleNone
  801.                   .Custom = False
  802.       
  803.                   ' Make the labels larger and change color
  804.                   .VtFont.Size = 12
  805.                   .VtFont.VtColor.Set 0, 0, 255
  806.                End With
  807.             Next dataPoint
  808.       
  809.          Case 2   ' +/- Data
  810.             .ChartType = VtChChartType2dHorizontalBar
  811.             Call QReadData(App.Path + VBARDATA2)
  812.       
  813.          Case 3   ' Picture Bars
  814.             Call QReadData(App.Path + VBARDATA3)
  815.             .ChartType = VtChChartType2dHorizontalBar
  816.       
  817.             ' Set the picture for each bar
  818.             For Each series In .Plot.SeriesCollection
  819.                With series.DataPoints.Item(-1).VtPicture
  820.                   .Type = VtPictureTypeBMP
  821.                   .Map = VtPictureMapTypeFitted
  822.                   .Embedded = 0
  823.                End With
  824.             Next series
  825.             .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).VtPicture.filename = App.Path & VTBMP1
  826.             .Plot.SeriesCollection.Item(2).DataPoints.Item(-1).VtPicture.filename = App.Path & VTBMP2
  827.             .Plot.SeriesCollection.Item(3).DataPoints.Item(-1).VtPicture.filename = App.Path & VTBMP3
  828.       
  829.          Case 4   ' Stacked
  830.             Call QReadData(App.Path + VBARDATA4)
  831.             .ChartType = VtChChartType2dHorizontalBar
  832.       
  833.             ' Stack all series on top of series 1
  834.             With .Plot.SeriesCollection
  835.                For i = 2 To .Count
  836.                   With .Item(i).Position
  837.                      .Excluded = False
  838.                      .Hidden = False
  839.                      .Order = 1
  840.                      .StackOrder = i
  841.                   End With
  842.                Next i
  843.             End With
  844.       
  845.          Case 5   ' Stacked Percent
  846.             Call QReadData(App.Path + VBARDATA5)
  847.             .ChartType = VtChChartType2dHorizontalBar
  848.       
  849.             ' Stack all series on top of series 1
  850.             With .Plot.SeriesCollection
  851.                For i = 2 To .Count
  852.                   With .Item(i).Position
  853.                      .Excluded = False
  854.                      .Hidden = False
  855.                      .Order = 1
  856.                      .StackOrder = i
  857.                   End With
  858.                Next i
  859.             End With
  860.       
  861.             ' Set axis to percent scaling
  862.             .Plot.Axis(VtChAxisIdY).AxisScale.Type = VtChScaleTypePercent
  863.             .Plot.Axis(VtChAxisIdY).AxisScale.PercentBasis = VtChPercentAxisBasisSumRow
  864.       
  865.          Case 6   ' 3D Default
  866.             Call QReadData(App.Path + VBARDATA1)
  867.             .ChartType = VtChChartType3dHorizontalBar
  868.       
  869.             ' Turn the legend off
  870.             .Legend.Location.Visible = False
  871.       
  872.             ' Set the width for a more pleasing view
  873.             .Plot.WidthToHeightRatio = 0.3
  874.             .Plot.DepthToHeightRatio = 4
  875.       
  876.             ' Set the elevation and rotation
  877.             Call QSet3DView(4, 3)
  878.       
  879.             ' Set Projection to oblique
  880.             .Plot.Projection = VtProjectionTypeOblique
  881.       
  882.             ' Set lighting
  883.             .Plot.light.LightSources.Remove (-1)
  884.             .Plot.light.LightSources.Add 0, -1, 2, 1
  885.       
  886.          Case 7   ' 3D Labeled
  887.             Call QReadData(App.Path + VBARDATA9)
  888.             .ChartType = VtChChartType3dHorizontalBar
  889.       
  890.             ' Turn the legend off
  891.             .Legend.Location.Visible = False
  892.       
  893.             '' Set all At Once ???
  894.             With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).DataPointLabel
  895.                'Set label location above point
  896.                .LocationType = VtChLabelLocationTypeAbovePoint
  897.                .Component = 1
  898.                .LineStyle = VtChLabelLineStyleNone
  899.                .Custom = False
  900.             
  901.                ' Make the labels larger and change color
  902.                .VtFont.Size = 12
  903.                .VtFont.VtColor.Set 0, 0, 255
  904.             End With
  905.       
  906.             ' Set the width for a more pleasing view
  907.             .Plot.WidthToHeightRatio = 0.3
  908.             .Plot.DepthToHeightRatio = 4
  909.       
  910.             ' Set the elevation and rotation
  911.             Call QSet3DView(4, 3)
  912.       
  913.             ' Set Projection to oblique
  914.             .Plot.Projection = VtProjectionTypeOblique
  915.             
  916.             ' Set lighting
  917.             .Plot.light.LightSources.Remove (-1)
  918.             .Plot.light.LightSources.Add 0, -1, 2, 1
  919.       
  920.             ' Change the axis label font size and color
  921.             Call QSetAxisLabel(VtChAxisIdX, True, 8, 0, 0, 0)
  922.       
  923.          Case 8  ' 3D With Walls
  924.             Call QReadData(App.Path + VBARDATA8)
  925.             .ChartType = VtChChartType3dHorizontalBar
  926.       
  927.             ' Set the width for a more pleasing view
  928.             .Plot.WidthToHeightRatio = 0.3
  929.             .Plot.DepthToHeightRatio = 0.4
  930.       
  931.             ' Turn the legend off
  932.             .Legend.Location.Visible = False
  933.       
  934.             ' Turn on walls
  935.             .Plot.Wall.Width = 20
  936.             .Plot.Wall.Brush.Style = VtBrushStyleSolid
  937.       
  938.             ' Change the axis label font size and color
  939.             Call QSetAxisLabel(VtChAxisIdX, True, 14, 0, 0, 255)
  940.             Call QSetAxisLabel(VtChAxisIdY, True, 14, 0, 0, 255)
  941.       
  942.       End Select
  943.    End With
  944. End Sub
  945.  
  946. Sub HiLowChart()
  947.    
  948.    Dim series As Object
  949.    Dim seriesType%
  950.    
  951.    Call DefaultChart
  952.    
  953.    Select Case HilowIndex
  954.       Case 0   ' Hi-Low
  955.          Call QReadData(App.Path + HILODATA)
  956.          seriesType = VtChSeriesType2dHiLo
  957.       Case 1   ' Hi-Low-Close
  958.          Call QReadData(App.Path + HILOCLDATA)
  959.          seriesType = VtChSeriesType2dHLC
  960.       Case 2   ' Open-Hi-Low-Close
  961.          Call QReadData(App.Path + OPENHILOCLDATA)
  962.          seriesType = VtChSeriesType2dOHLC
  963.       Case 3 ' Hi-Low-Close-Side Bar
  964.          Call QReadData(App.Path + HILOCLDATA)
  965.          seriesType = VtChSeriesType2dHLCRight
  966.       Case Else   ' Open-Hi-Low-Closed - Bar
  967.          Call QReadData(App.Path + OPENHILOCLDATA)
  968.          seriesType = VtChSeriesType2dOHLCBar
  969.    End Select
  970.    
  971.    With frmMain.vtchart1
  972.       ' Set the chart type to hi-low
  973.       .ChartType = VtChChartType2dHiLo
  974.       For Each series In .Plot.SeriesCollection
  975.          series.seriesType = seriesType
  976.       Next series
  977.    
  978.       ' Change bar color to blue
  979.       Call QSetSeriesColor(1, 0, 0, 255)
  980.  
  981.       ' Change the gain and loss colors
  982.       With .Plot.SeriesCollection.Item(1).HiLo
  983.          .GainColor.Automatic = False
  984.          .GainColor.Set 0, 255, 0
  985.          .LossColor.Automatic = False
  986.          .LossColor.Set 255, 0, 0
  987.       End With
  988.    End With
  989.  
  990. End Sub
  991.  
  992. Sub LineChart()
  993.  
  994.    Dim series As Object, dataPoint As Object, i%, theLineStyle%
  995.    
  996.    Call DefaultChart
  997.    
  998.    With frmMain.vtchart1
  999.       Select Case LineIndex
  1000.       
  1001.       Case 0   ' 2D Line
  1002.       .ChartType = VtChChartType2dLine
  1003.       Call QReadData(App.Path + VLINEDATA9)
  1004.       
  1005.       
  1006.       Case 1   ' Labeled
  1007.       .ChartType = VtChChartType2dLine
  1008.       Call QReadData(App.Path + VLINEDATA7)
  1009.       
  1010.       ' Label the points
  1011.       For Each series In .Plot.SeriesCollection
  1012.          With series.DataPoints.Item(-1).DataPointLabel
  1013.             .LocationType = VtChLabelLocationTypeAbovePoint
  1014.             .Component = VtChLabelComponentValue
  1015.             .LineStyle = VtChLabelLineStyleNone
  1016.       
  1017.             ' Make the labels larger and change color
  1018.             .VtFont.Size = 12
  1019.             .VtFont.VtColor.Set 0, 0, 255
  1020.          End With
  1021.       Next series
  1022.       
  1023.       'Set Y axis scale
  1024.       '' If maximum > minimum, the maximum MUST be set first
  1025.       With .Plot.Axis(VtChAxisIdY).ValueScale
  1026.          .Auto = False
  1027.          .Maximum = 1050
  1028.          .Minimum = 800
  1029.          .MajorDivision = 5
  1030.          .MinorDivision = 1
  1031.       End With
  1032.       
  1033.       Case 2   ' Series Labels
  1034.          .ChartType = VtChChartType2dLine
  1035.          Call QReadData(App.Path + VAREADATA1)
  1036.       
  1037.          For Each series In .Plot.SeriesCollection
  1038.             With series.SeriesLabel
  1039.                .LocationType = VtChLabelLocationTypeRight
  1040.                .LineStyle = VtChLabelLineStyleNone
  1041.                ' Set the label font
  1042.                .VtFont.Size = 8
  1043.                .VtFont.VtColor.Set 0, 0, 255
  1044.          
  1045.                ' Set the label backdrop
  1046.                With .Backdrop
  1047.                   .Frame.Style = VtFrameStyleSingleLine
  1048.                   .Frame.FrameColor.Set 0, 0, 0
  1049.                   .Fill.Style = VtFillStyleBrush
  1050.                   .Fill.Brush.Style = VtBrushStyleSolid
  1051.                   .Fill.Brush.FillColor.Set 225, 225, 225
  1052.                End With
  1053.             End With
  1054.          Next series
  1055.       
  1056.       Case 3   ' +/- Data
  1057.          .ChartType = VtChChartType2dLine
  1058.          Call QReadData(App.Path + VLINEDATA2)
  1059.       
  1060.       Case 4   ' Smoothed
  1061.          .ChartType = VtChChartType2dLine
  1062.          Call QReadData(App.Path + VLINEDATA10)
  1063.       
  1064.          ' Smooth the series
  1065.          With .Plot.SeriesCollection
  1066.             .Item(2).SmoothingFactor = 10
  1067.             .Item(2).SmoothingType = VtSmoothingTypeQuadraticBSpline
  1068.             .Item(3).SmoothingFactor = 10
  1069.             .Item(3).SmoothingType = VtSmoothingTypeCubicBSpline
  1070.          End With
  1071.       
  1072.       Case 5   ' Markers
  1073.          .ChartType = VtChChartType2dLine
  1074.          Call QReadData(App.Path + VLINEDATA1)
  1075.       
  1076.          ' Set markers on
  1077.          For Each series In .Plot.SeriesCollection
  1078.             series.SeriesMarker.show = True
  1079.             series.ShowLine = True
  1080.          Next series
  1081.       
  1082.       Case 6   ' Line Styles
  1083.          .ChartType = VtChChartType2dLine
  1084.          Call QReadData(App.Path + VLINEDATA1)
  1085.       
  1086.          'set all lines to smooth
  1087.          theLineStyle = VtPenStyleDashed
  1088.          For Each series In .Plot.SeriesCollection
  1089.             series.SmoothingFactor = 10
  1090.             series.SmoothingType = VtSmoothingTypeQuadraticBSpline
  1091.             With series.Pen
  1092.                .Style = theLineStyle
  1093.                .Join = VtPenJoinMiter
  1094.                .Cap = VtPenCapButt
  1095.                .Width = 4
  1096.             End With
  1097.             theLineStyle = theLineStyle + 1
  1098.          Next series
  1099.       
  1100.       Case 7   ' Thick Lines
  1101.          .ChartType = VtChChartType2dLine
  1102.          Call QReadData(App.Path + VLINEDATA1)
  1103.       
  1104.          ' Make lines smooth and thick
  1105.          For Each series In .Plot.SeriesCollection
  1106.             series.SmoothingFactor = 10
  1107.             series.SmoothingType = VtSmoothingTypeQuadraticBSpline
  1108.             With series.Pen
  1109.                .Style = VtPenStyleSolid
  1110.                .Join = VtPenJoinRound
  1111.                .Cap = VtPenCapRound
  1112.                .Width = 8
  1113.             End With
  1114.          Next series
  1115.       
  1116.       Case 8   ' Log Axis
  1117.          .ChartType = VtChChartType2dLine
  1118.          Call QReadData(App.Path + VLINEDATA6)
  1119.  
  1120.          ' Set to log axis
  1121.          .Plot.Axis(VtChAxisIdY).AxisScale.Type = VtChScaleTypeLogarithmic
  1122.          .Plot.Axis(VtChAxisIdY).AxisScale.PercentBasis = VtChPercentAxisBasisMaxChart
  1123.       
  1124.       Case 9   ' 2nd Y Axis
  1125.          .ChartType = VtChChartType2dLine
  1126.          Call QReadData(App.Path + VLINEDATA5)
  1127.       
  1128.          ' Turn on second Y axis
  1129.          .Plot.Axis(VtChAxisIdY2).AxisScale.Type = VtChScaleTypeLinear
  1130.          .Plot.Axis(VtChAxisIdY2).AxisScale.PercentBasis = VtChPercentAxisBasisMaxChart
  1131.          .Plot.Axis(VtChAxisIdY2).AxisScale.Hide = False
  1132.          .Plot.SeriesCollection.Item(2).SecondaryAxis = True
  1133.          
  1134.          ' Set Axis Scale
  1135.          '' If max > existing min, MUST set max first
  1136.          With .Plot.Axis(VtChAxisIdY).ValueScale
  1137.             .Auto = False
  1138.             .Maximum = 80
  1139.             .Minimum = 70
  1140.             .MajorDivision = 5
  1141.             .MinorDivision = 1
  1142.          End With
  1143.          With .Plot.Axis(VtChAxisIdY2).ValueScale
  1144.             .Auto = False
  1145.             .Maximum = 0.7
  1146.             .Minimum = 0.3
  1147.             .MajorDivision = 5
  1148.             .MinorDivision = 1
  1149.          End With
  1150.       
  1151.       Case 10   ' Missing Data
  1152.          .ChartType = VtChChartType2dLine
  1153.          Call QReadData(App.Path + VLINEDATA7)
  1154.       
  1155.          ' Clear some data so it is missing
  1156.          .Row = 5
  1157.          .Column = 1
  1158.          .Data = ""
  1159.       
  1160.          ' Set the pen to create a thick line ???
  1161.          With .Plot.SeriesCollection.Item(1).Pen
  1162.             .Style = VtPenStyleSolid
  1163.             .Join = VtPenJoinRound
  1164.             .Cap = VtPenCapRound
  1165.             .Width = 6
  1166.          End With
  1167.          
  1168.          ' Set Y axis scale
  1169.          With .Plot.Axis(VtChAxisIdY).ValueScale
  1170.             .Auto = False
  1171.             .Maximum = 1050
  1172.             .Minimum = 800
  1173.             .MajorDivision = 5
  1174.             .MinorDivision = 1
  1175.          End With
  1176.       
  1177.       Case 11  ' Statistics
  1178.          .ChartType = VtChChartType2dLine
  1179.          Call QReadData(App.Path + VLINEDATA7)
  1180.       
  1181.          ' Turn the statistics on
  1182.          With .Plot.SeriesCollection.Item(1).StatLine
  1183.             .Flag = VtChStatsMinimum Or VtChStatsMaximum Or VtChStatsMean Or VtChStatsStddev Or VtChStatsRegression
  1184.             .VtColor.Set 255, 0, 0
  1185.             .Width = 1
  1186.          End With
  1187.          
  1188.          ' Make the Series Line Blue
  1189.          Call QSetSeriesColor(1, 0, 0, 255)
  1190.       
  1191.          ' Set Y axis scale
  1192.          With .Plot.Axis(VtChAxisIdY).ValueScale
  1193.             .Auto = False
  1194.             .Maximum = 1050
  1195.             .Minimum = 800
  1196.             .MajorDivision = 5
  1197.             .MinorDivision = 1
  1198.          End With
  1199.       
  1200.       Case 12  ' 2D Guidelines
  1201.          .ChartType = VtChChartType2dLine
  1202.          Call QReadData(App.Path + VLINEDATA2)
  1203.       
  1204.       
  1205.          ' Turn on Guidelines
  1206.          For Each series In .Plot.SeriesCollection
  1207.             series.ShowGuideLine(VtChAxisIdX) = True
  1208.          Next series
  1209.          
  1210.          '' Turn off the axis grid
  1211.          .Plot.Axis(VtChAxisIdX).AxisGrid.MinorPen.Style = VtPenStyleNull
  1212.          .Plot.Axis(VtChAxisIdY).AxisGrid.MinorPen.Style = VtPenStyleNull
  1213.          .Plot.Axis(VtChAxisIdY2).AxisGrid.MinorPen.Style = VtPenStyleNull
  1214.       
  1215.       Case 13  ' 3D Line
  1216.          .ChartType = VtChChartType3dLine
  1217.          Call QReadData(App.Path + VLINEDATA1)
  1218.       
  1219.          ' Set the width for a more pleasing view
  1220.          .Plot.WidthToHeightRatio = 2
  1221.          .Plot.DepthToHeightRatio = 3
  1222.       
  1223.          ' Set the elevation and rotation
  1224.          Call QSet3DView(65, 19)
  1225.       
  1226.          ' Turn the legend off
  1227.          .Legend.Location.Visible = False
  1228.       
  1229.          ' Thicken the line
  1230.          For Each series In .Plot.SeriesCollection
  1231.             With series.Pen
  1232.                .Style = VtPenStyleSolid
  1233.                .Join = VtPenJoinRound
  1234.                .Cap = VtPenCapButt
  1235.                .Width = 8
  1236.             End With
  1237.          Next series
  1238.          
  1239.          ' Turn off X, Y, Y2 and Z axis
  1240.          Call QSetAxisLabel(VtChAxisIdX, False, 14, 0, 0, 202)
  1241.          Call QSetAxisLabel(VtChAxisIdY, False, 14, 0, 0, 202)
  1242.          Call QSetAxisLabel(VtChAxisIdY2, False, 14, 0, 0, 202)
  1243.          Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  1244.       
  1245.       Case 14  ' 3D Labeled
  1246.          .ChartType = VtChChartType3dLine
  1247.          Call QReadData(App.Path + VLINEDATA4)
  1248.       
  1249.          ' Set the width for a more pleasing view
  1250.          .Plot.WidthToHeightRatio = 2
  1251.          .Plot.DepthToHeightRatio = 3
  1252.       
  1253.          ' Set the elevation and rotation
  1254.          Call QSet3DView(77, 27)
  1255.       
  1256.          ' Turn the legend off
  1257.          .Legend.Location.Visible = False
  1258.          
  1259.          ' Thicken the line
  1260.          With .Plot.SeriesCollection.Item(1).Pen
  1261.             .Style = VtPenStyleSolid
  1262.             .Join = VtPenJoinRound
  1263.             .Cap = VtPenCapButt
  1264.             .Width = 6
  1265.          End With
  1266.       
  1267.          ' Label the point
  1268.          With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).DataPointLabel
  1269.             .LocationType = VtChLabelLocationTypeAbovePoint
  1270.             .Component = VtChLabelComponentValue
  1271.             .LineStyle = VtChLabelLineStyleNone
  1272.             .Custom = False
  1273.       
  1274.             'Make the labels larger and change color
  1275.             .VtFont.Size = 14
  1276.             .VtFont.VtColor.Set 0, 0, 255
  1277.          End With
  1278.          
  1279.          ' Set Y axis scale
  1280.          With .Plot.Axis(VtChAxisIdY).ValueScale
  1281.             .Auto = False
  1282.             .Maximum = 125
  1283.             .Minimum = 100
  1284.             .MajorDivision = 5
  1285.             .MinorDivision = 1
  1286.          End With
  1287.       
  1288.          ' Turn off X, Y, Y2 and Z axis
  1289.          Call QSetAxisLabel(VtChAxisIdX, False, 14, 0, 0, 202)
  1290.          Call QSetAxisLabel(VtChAxisIdY, False, 14, 0, 0, 202)
  1291.          Call QSetAxisLabel(VtChAxisIdY2, False, 14, 0, 0, 202)
  1292.          Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  1293.       
  1294.       Case 15, 16  ' Smoothed and 3D Line Styles
  1295.          .ChartType = VtChChartType3dLine
  1296.          Call QReadData(App.Path + VLINEDATA11)
  1297.       
  1298.          ' Turn title off
  1299.          .Title.Location.Visible = False
  1300.       
  1301.          ' Turn Plot Frame Off
  1302.          .Plot.Backdrop.Frame.Style = VtFrameStyleNull
  1303.          .Plot.Backdrop.Shadow.Style = VtShadowStyleNull
  1304.       
  1305.          ' Set the width for a more pleasing view
  1306.          .Plot.WidthToHeightRatio = 1.5
  1307.          .Plot.DepthToHeightRatio = 1.5
  1308.       
  1309.          ' Turn the legend off
  1310.          .Legend.Location.Visible = False
  1311.       
  1312.          ' Smooth the series lines
  1313.          For Each series In .Plot.SeriesCollection
  1314.             series.SmoothingFactor = 12
  1315.             series.SmoothingType = VtSmoothingTypeQuadraticBSpline
  1316.          
  1317.             'set the style and pen to create a thick styled line
  1318.             With series.Pen
  1319.                .Style = IIf(LineIndex = 15, VtPenStyleSolid, VtPenStyleDashed)
  1320.                .Join = VtPenJoinMiter
  1321.                .Cap = VtPenCapButt
  1322.                .Width = 6
  1323.             End With
  1324.          Next series
  1325.       
  1326.       ' Set the elevation and rotation
  1327.       Call QSet3DView(39, 7)
  1328.       
  1329.       ' Set Projection and perspective
  1330.       .Plot.Projection = VtProjectionTypePerspective
  1331.       .Plot.Perspective.Set 0.5, 0.5, 0.5
  1332.       
  1333.       ' Set axis grids to null -- major / minor reversed
  1334.       .Plot.Axis(VtChAxisIdX).AxisGrid.MinorPen.Style = VtPenStyleNull
  1335.       .Plot.Axis(VtChAxisIdZ).AxisGrid.MinorPen.Style = VtPenStyleNull
  1336.       
  1337.       ' Turn off X and Z axis, Turn on Y and Y2
  1338.       Call QSetAxisLabel(VtChAxisIdX, False, 14, 0, 0, 202)
  1339.       Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  1340.       
  1341.       ' Make Y and Y2 axis fonts larger
  1342.       Call QSetAxisLabel(VtChAxisIdY, True, 18, 0, 0, 202)
  1343.       Call QSetAxisLabel(VtChAxisIdY2, True, 18, 0, 0, 202)
  1344.       
  1345.       ' Set lighting to upper right corner
  1346.       ' first turn off all current lights
  1347.       .Plot.light.LightSources.Remove (-1)
  1348.       .Plot.light.LightSources.Add -3, -1, 2, 1
  1349.       
  1350.       ' Turn Edge Lighting Off
  1351.       .Plot.light.EdgeVisible = False
  1352.       
  1353.       ' Turn ambient light down
  1354.       .Plot.light.AmbientIntensity = 0
  1355.       
  1356.       ' Change Series Colors
  1357.       Call QSetSeriesColor(3, 128, 0, 128)  ' Purple
  1358.       Call QSetSeriesColor(4, 0, 160, 240)  ' Blue
  1359.       Call QSetSeriesColor(5, 255, 35, 170) ' Pink
  1360.       
  1361.       End Select
  1362.    End With
  1363. End Sub
  1364.  
  1365. Sub MultiChart()
  1366.    
  1367.    Dim theRow%, theCol%, theLabel$
  1368.    
  1369.    Call DefaultChart
  1370.    
  1371.    Call QReadData(App.Path + MDDATA1)
  1372.    
  1373.    With frmMain.vtchart1
  1374.       .ColumnCount = 4 ' Data has two sets of 4
  1375.       
  1376.       ' Add extra dimension
  1377.       .RowLabelCount = .RowLabelCount + 1
  1378.       .rowCount = .rowCount * 2
  1379.       .RowLabelIndex = 2
  1380.       .Row = 1
  1381.       .RowLabel = "1993"
  1382.       .Row = 5
  1383.       .RowLabel = "1994"
  1384.       
  1385.       ' Replicate the inside labels
  1386.       .RowLabelIndex = 1
  1387.       For theRow = 1 To 4
  1388.          .Row = theRow
  1389.          theLabel = .RowLabel
  1390.          .Row = theRow + 4
  1391.          .RowLabel = theLabel
  1392.       Next theRow
  1393.       
  1394.       ' Add New Data Points
  1395.       For theRow = 1 To 4
  1396.          .Column = theRow
  1397.          For theCol = 1 To 8
  1398.             .Row = theCol
  1399.             frmData.Grid1.Row = theRow + 1
  1400.             frmData.Grid1.Col = theCol + 1
  1401.             .Data = Val(frmData.Grid1.Text)
  1402.          Next theCol
  1403.       Next theRow
  1404.       
  1405.       Select Case MultiIndex
  1406.          Case 0   '2D Multi Combo
  1407.             .ChartType = VtChChartType2dCombination
  1408.          Case 1   '3D Multi Combo
  1409.             .ChartType = VtChChartType3dCombination
  1410.          Case 2   '3D Multi Pie
  1411.             .ChartType = VtChChartType3dPie
  1412.       End Select
  1413.       
  1414.       ' Set the width for a more pleasing view
  1415.       .Plot.WidthToHeightRatio = 2
  1416.       .Plot.DepthToHeightRatio = 2
  1417.       
  1418.       ' Make sure legend is off
  1419.       .Legend.Location.Visible = False
  1420.       
  1421.       'Set the title font
  1422.       .Title.VtFont.Size = 16
  1423.       .Title.VtFont.VtColor.Set 255, 255, 0
  1424.       
  1425.       ' Change each series
  1426.       With .Plot.SeriesCollection
  1427.          .Item(1).seriesType = VtChSeriesType3dLine
  1428.          .Item(2).seriesType = VtChSeriesType3dBar
  1429.          .Item(3).seriesType = VtChSeriesType3dArea
  1430.          .Item(4).seriesType = VtChSeriesType3dStep
  1431.       End With
  1432.       
  1433.       ' Set line to dashed line
  1434.       With .Plot.SeriesCollection.Item(1).Pen
  1435.          .Style = VtPenStyleDashed
  1436.          .Join = VtPenJoinMiter
  1437.          .Cap = VtPenCapButt
  1438.          .Width = 8
  1439.       End With
  1440.       
  1441.       ' Set bar shapes to cylinder
  1442.       .Plot.SeriesCollection.Item(2).Bar.Sides = 32
  1443.       .Plot.SeriesCollection.Item(2).Bar.TopRatio = 1
  1444.       
  1445.       ' Smooth the area
  1446.       .Plot.SeriesCollection.Item(3).SmoothingFactor = 10
  1447.       .Plot.SeriesCollection.Item(3).SmoothingType = VtSmoothingTypeQuadraticBSpline
  1448.       
  1449.       ' Change Series Colors
  1450.       Call QSetSeriesColor(1, 77, 191, 64) ' Greenish
  1451.       Call QSetSeriesColor(2, 50, 163, 205) ' Blueish
  1452.       Call QSetSeriesColor(3, 208, 47, 139) ' Redish
  1453.       
  1454.       ' Set the chart background to gradient
  1455.       With .Backdrop
  1456.          .Frame.Style = VtFrameStyleSingleLine
  1457.          .Fill.Style = VtFillStyleGradient
  1458.          With .Fill.Gradient
  1459.             .Style = VtGradientStyleRectangle
  1460.             .FromColor.Set 255, 255, 255
  1461.             .ToColor.Set 100, 100, 255
  1462.          End With
  1463.       End With
  1464.       
  1465.       ' Plot Backdrop is Null
  1466.       .Plot.Backdrop.Frame.Style = VtFrameStyleNull
  1467.       .Plot.Backdrop.Shadow.Style = VtShadowStyleNull
  1468.       .Plot.Backdrop.Fill.Style = VtFillStyleNull
  1469.       
  1470.       ' Chart walls a little thick
  1471.       .Plot.Wall.Width = 10
  1472.       .Plot.Wall.Brush.Style = VtBrushStyleSolid
  1473.       
  1474.       ' Change the axis label font size and color
  1475.       Call QSetAxisLabel(VtChAxisIdX, True, 14, 0, 0, 202)
  1476.       Call QSetAxisLabel(VtChAxisIdY, True, 14, 0, 0, 202)
  1477.       Call QSetAxisLabel(VtChAxisIdZ, True, 14, 0, 0, 202)
  1478.       
  1479.       ' Set 2nd level axis labels
  1480.       '' should this work with type three
  1481.       If MultiIndex <> 2 Then
  1482.          With .Plot.Axis(VtChAxisIdX).Labels.Item(2).VtFont
  1483.             .Size = 16
  1484.             .VtColor.Set 0, 0, 202
  1485.          End With
  1486.       End If
  1487.    
  1488.    End With
  1489. End Sub
  1490.  
  1491. Sub OptionChart()
  1492.  
  1493.    Dim series As Object, dataPoint As Object
  1494.    Dim i%
  1495.    
  1496.    ' Reset all chart options
  1497.    Call DefaultChart
  1498.    
  1499.    With frmMain.vtchart1
  1500.       ' Turn the legend off
  1501.       .Legend.Location.Visible = False
  1502.       
  1503.       Select Case OptionIndex
  1504.       
  1505.          Case 0   'Title Fill
  1506.             .ChartType = VtChChartType2dLine
  1507.             Call QReadData(App.Path + VLINEDATA9)
  1508.       
  1509.             ' Set chart backdrop to rectangle gradient
  1510.             With .Backdrop.Fill
  1511.                .Style = VtFillStyleGradient
  1512.                .Gradient.Style = VtGradientStyleVertical
  1513.                .Gradient.FromColor.Set 225, 252, 252
  1514.                .Gradient.ToColor.Set 96, 96, 96
  1515.             End With
  1516.  
  1517.             'Set the Plot background to Null (Invisible)
  1518.             With .Plot.Backdrop
  1519.                .Frame.Style = VtFrameStyleSingleLine
  1520.                With .Shadow
  1521.                   .Style = VtShadowStyleDrop
  1522.                   .Brush.Style = VtBrushStyleSolid
  1523.                   .Brush.FillColor.Set 0, 0, 0
  1524.                   .Offset.X = 2.5
  1525.                   .Offset.Y = 2.5
  1526.                End With
  1527.                With .Fill
  1528.                   .VtPicture.filename = ""
  1529.                   .Style = VtFillStyleBrush
  1530.                   .Brush.Style = VtBrushStyleNull
  1531.                End With
  1532.             End With
  1533.       
  1534.             For Each series In .Plot.SeriesCollection
  1535.                ' Turn markers and lines on
  1536.                series.SeriesMarker.Auto = False
  1537.                series.SeriesMarker.show = True
  1538.                series.ShowLine = True
  1539.                
  1540.                   ' Change the marker to a Circle
  1541.                With series.DataPoints.Item(-1).Marker
  1542.                   .Style = VtMarkerStyleCircle
  1543.                   .Pen.VtColor.Set 0, 0, 255
  1544.                   .Pen.Width = 2
  1545.                End With
  1546.             Next series
  1547.       
  1548.             ' Set the title backdrop and color
  1549.             With .Title.Backdrop
  1550.                .Frame.Style = VtFrameStyleThickOuter
  1551.                .Frame.FrameColor.Set 0, 0, 0
  1552.                .Fill.Style = VtFillStyleBrush
  1553.                .Fill.Brush.Style = VtBrushStyleSolid
  1554.                .Fill.Brush.FillColor.Set 3, 182, 177
  1555.             End With
  1556.       
  1557.             ' Set the title font
  1558.             .Title.VtFont.Size = 16
  1559.             .Title.VtFont.VtColor.Set 255, 255, 255
  1560.       
  1561.             ' Set Axis Grids and Fonts to White
  1562.             For i = VtChAxisIdX To VtChAxisIdZ
  1563.                With .Plot.Axis(i)
  1564.                   .AxisGrid.MinorPen.VtColor.Set 249, 253, 215
  1565.                   .AxisGrid.MajorPen.VtColor.Set 249, 253, 215
  1566.                   .Pen.VtColor.Set 249, 253, 215
  1567.                End With
  1568.             Next i
  1569.          
  1570.          Case 1   'Title Gradient
  1571.             Call QReadData(App.Path + VBARDATA1)
  1572.             .ChartType = VtChChartType2dBar
  1573.       
  1574.             ' Set title backdrop
  1575.             With .Title.Backdrop
  1576.                .Frame.Style = VtFrameStyleThickOuter
  1577.                .Frame.FrameColor.Set 0, 0, 255
  1578.                'Set to gradient fill
  1579.                .Fill.Style = VtFillStyleGradient
  1580.                With .Fill.Gradient
  1581.                   .Style = VtGradientStyleOval
  1582.                   .FromColor.Set 255, 255, 255
  1583.                   .ToColor.Set 100, 100, 255
  1584.                End With
  1585.             End With
  1586.       
  1587.             'Set the title font
  1588.             .Title.VtFont.Size = 18
  1589.             .Title.VtFont.VtColor.Set 255, 0, 0
  1590.       
  1591.             ' Put a picture in each bar
  1592.             For Each series In .Plot.SeriesCollection
  1593.                With series.DataPoints.Item(-1).VtPicture
  1594.                   .Type = VtPictureTypeWMF
  1595.                   .Map = VtPictureMapTypeTiled
  1596.                   .Embedded = 0
  1597.                   .filename = App.Path & VTWMF6
  1598.                End With
  1599.             Next series
  1600.       
  1601.             .Plot.xGap = 0.05
  1602.       
  1603.          Case 2   'Title Picture
  1604.             Call QReadData(App.Path + VBARDATA1)
  1605.             .ChartType = VtChChartType2dBar
  1606.       
  1607.             ' Put picture in title
  1608.             With .Title.Backdrop.Fill
  1609.                .Style = VtFillStyleBrush
  1610.                .Brush.Style = VtBrushStyleSolid
  1611.                .Brush.FillColor.Set 255, 255, 0
  1612.                .VtPicture.filename = App.Path & VTWMF5
  1613.                .VtPicture.Map = VtPictureMapTypeStretched
  1614.                .VtPicture.Type = VtPictureTypeWMF
  1615.             End With
  1616.       
  1617.             .Title = " "
  1618.       
  1619.             ' Set the Plot background
  1620.             With .Plot.Backdrop
  1621.                .Shadow.Style = VtShadowStyleNull
  1622.                .Frame.Style = VtFrameStyleNull
  1623.                With .Fill
  1624.                   .VtPicture.filename = ""
  1625.                   .Style = VtFillStyleBrush
  1626.                   .Brush.Style = VtBrushStyleSolid
  1627.                   .Brush.FillColor.Set 255, 255, 0
  1628.                End With
  1629.             End With
  1630.       
  1631.             ' Set plot size
  1632.             .Plot.AutoLayout = False
  1633.             .Plot.LocationRect.Min.Y = 1
  1634.       
  1635.             ' Set title size
  1636.             .Title.Location.Visible = True
  1637.             .Title.Location.LocationType = VtChLocationTypeCustom
  1638.             .Title.Location.Rect.Max.Set .Plot.LocationRect.Max.X, .Plot.LocationRect.Min.Y
  1639.             .Title.Location.Rect.Min.Set .Plot.LocationRect.Min.X, 0.18
  1640.       
  1641.          Case 3   'BD Gradient Rectangle
  1642.             Call QReadData(App.Path + VBARDATA1)
  1643.             .ChartType = VtChChartType2dLine
  1644.       
  1645.             ' Set the pen to create a thick line
  1646.             With .Plot.SeriesCollection.Item(1).Pen
  1647.                .Style = VtPenStyleDotted
  1648.                .Join = VtPenJoinRound
  1649.                .Cap = VtPenCapRound
  1650.                .Width = 12
  1651.             End With
  1652.       
  1653.             'Set chart backdrop to rectangle gradient
  1654.             With .Backdrop.Fill
  1655.                .Style = VtFillStyleGradient
  1656.                .Gradient.Style = VtGradientStyleRectangle
  1657.                .Gradient.FromColor.Set 255, 255, 255
  1658.                .Gradient.ToColor.Set 100, 100, 255
  1659.             End With
  1660.       
  1661.             'Set the plot background to null (invisible)
  1662.             With .Plot.Backdrop
  1663.                .Frame.Style = VtFrameStyleSingleLine
  1664.                .Shadow.Style = VtShadowStyleDrop
  1665.                .Shadow.Brush.Style = VtBrushStyleSolid
  1666.                .Shadow.Brush.FillColor.Set 0, 0, 0
  1667.                .Shadow.Offset.X = 2.5
  1668.                .Shadow.Offset.Y = 2.5
  1669.                .Fill.VtPicture.filename = ""
  1670.                .Fill.Style = VtFillStyleBrush
  1671.                .Fill.Brush.Style = VtBrushStyleNull
  1672.             End With
  1673.       
  1674.             'Set the title font
  1675.             .Title.VtFont.Size = 16
  1676.             .Title.VtFont.VtColor.Set 255, 255, 255
  1677.       
  1678.          Case 4   'BD Gradient Oval
  1679.             Call QReadData(App.Path + VBARDATA1)
  1680.             .ChartType = VtChChartType3dBar
  1681.       
  1682.             ' Set the width for a more pleasing view
  1683.             .Plot.WidthToHeightRatio = 2
  1684.             .Plot.DepthToHeightRatio = 2
  1685.       
  1686.             ' Set the elevation and rotation
  1687.             Call QSet3DView(112, 31)
  1688.       
  1689.             ' Make bars into pyramids
  1690.             .Plot.SeriesCollection.Item(1).Bar.Sides = 4
  1691.             .Plot.SeriesCollection.Item(1).Bar.TopRatio = 0
  1692.       
  1693.             'Oval Gradient
  1694.             With .Backdrop.Fill
  1695.                .Style = VtFillStyleGradient
  1696.                .Gradient.Style = VtGradientStyleOval
  1697.                .Gradient.FromColor.Set 255, 255, 255
  1698.                .Gradient.ToColor.Set 100, 100, 255
  1699.             End With
  1700.             
  1701.             'Set the plot background to null (invisible)
  1702.             With .Plot.Backdrop
  1703.                .Frame.Style = VtFrameStyleSingleLine
  1704.                With .Shadow
  1705.                   .Style = VtShadowStyleDrop
  1706.                   .Brush.Style = VtBrushStyleSolid
  1707.                   .Brush.FillColor.Set 0, 0, 0
  1708.                   .Offset.X = 2.5
  1709.                   .Offset.Y = 2.5
  1710.                End With
  1711.                .Fill.VtPicture.filename = ""
  1712.                .Fill.Style = VtFillStyleBrush
  1713.                .Fill.Brush.Style = VtBrushStyleNull
  1714.             End With
  1715.       
  1716.             'Set the title font
  1717.             .Title.VtFont.Size = 16
  1718.             .Title.VtFont.VtColor.Set 255, 255, 0
  1719.       
  1720.          Case 5   'BD Gradient Horizontal
  1721.             Call QReadData(App.Path + VBARDATA1)
  1722.             .ChartType = VtChChartType2dLine
  1723.       
  1724.             ' Set the pen to create a thick line
  1725.             With .Plot.SeriesCollection.Item(1).Pen
  1726.                .Style = VtPenStyleDashDot
  1727.                .Join = VtPenJoinRound
  1728.                .Cap = VtPenCapRound
  1729.                .Width = 12
  1730.             End With
  1731.       
  1732.             'Horizontal Gradient
  1733.             With .Backdrop.Fill
  1734.                .Style = VtFillStyleGradient
  1735.                .Gradient.Style = VtGradientStyleHorizontal
  1736.                .Gradient.FromColor.Set 255, 255, 255
  1737.                .Gradient.ToColor.Set 100, 100, 255
  1738.             End With
  1739.       
  1740.             'Set the plot background to null (invisible)
  1741.             With .Plot.Backdrop
  1742.                .Frame.Style = VtFrameStyleSingleLine
  1743.                With .Shadow
  1744.                   .Style = VtShadowStyleDrop
  1745.                   .Brush.Style = VtBrushStyleSolid
  1746.                   .Brush.FillColor.Set 0, 0, 0
  1747.                   .Offset.X = 2.5
  1748.                   .Offset.Y = 2.5
  1749.                End With
  1750.                .Fill.VtPicture.filename = ""
  1751.                .Fill.Style = VtFillStyleBrush
  1752.                .Fill.Brush.Style = VtBrushStyleNull
  1753.             End With
  1754.       
  1755.             'Set the title font
  1756.             .Title.VtFont.Size = 16
  1757.             .Title.VtFont.VtColor.Set 255, 0, 0
  1758.       
  1759.          Case 6   'BD Gradient Vertical
  1760.             Call QReadData(App.Path + VBARDATA1)
  1761.             .ChartType = VtChChartType2dBar
  1762.       
  1763.             'VerticalGradient
  1764.             With .Backdrop.Fill
  1765.                .Style = VtFillStyleGradient
  1766.                .Gradient.Style = VtGradientStyleVertical
  1767.                .Gradient.FromColor.Set 255, 255, 255
  1768.                .Gradient.ToColor.Set 100, 100, 255
  1769.             End With
  1770.       
  1771.             'Set the plot background to null (invisible)
  1772.             With .Plot.Backdrop
  1773.                .Frame.Style = VtFrameStyleSingleLine
  1774.                With .Shadow
  1775.                   .Style = VtShadowStyleDrop
  1776.                   .Brush.Style = VtBrushStyleSolid
  1777.                   .Brush.FillColor.Set 0, 0, 0
  1778.                   .Offset.X = 2.5
  1779.                   .Offset.Y = 2.5
  1780.                End With
  1781.                With .Fill
  1782.                   .VtPicture.filename = ""
  1783.                   .Style = VtFillStyleBrush
  1784.                   .Brush.Style = VtBrushStyleNull
  1785.                End With
  1786.             End With
  1787.       
  1788.             'Set the title font
  1789.             .Title.VtFont.Size = 16
  1790.             .Title.VtFont.VtColor.Set 255, 255, 0
  1791.       
  1792.             ' Change the color/fill of the  series
  1793.             With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1)
  1794.                With .Brush
  1795.                   .Style = VtBrushStyleHatched
  1796.                   .Index = VtBrushHatchDiagonalCross
  1797.                   .FillColor.Set 255, 0, 0
  1798.                   .PatternColor.Set 0, 0, 255
  1799.                End With
  1800.                With .EdgePen
  1801.                   .Style = VtPenStyleSolid
  1802.                   .Width = 2
  1803.                   .VtColor.Set 255, 0, 0
  1804.                   .VtColor.Automatic = False
  1805.                End With
  1806.             End With
  1807.       
  1808.          Case 7   'BD Picture Tiled
  1809.             Call QReadData(App.Path + VBARDATA1)
  1810.             .ChartType = VtChChartType2dArea
  1811.       
  1812.             ' Set chart backdrop to tiled BMP picture
  1813.             .Backdrop.Fill.Style = VtFillStyleNull
  1814.             .Backdrop.Fill.VtPicture.filename = App.Path & VTBMP3
  1815.             .Backdrop.Fill.VtPicture.Map = VtPictureMapTypeTiled
  1816.             
  1817.             ' Set the title font
  1818.             .Title.VtFont.Size = 16
  1819.             .Title.VtFont.VtColor.Set 0, 0, 255
  1820.       
  1821.             'Set Title frame and backdrop
  1822.             With .Title.Backdrop
  1823.                .Frame.Style = VtFrameStyleThickOuter
  1824.                .Frame.FrameColor.Set 0, 0, 255
  1825.                .Fill.Style = VtFillStyleBrush
  1826.                .Fill.Brush.Style = VtBrushStyleSolid
  1827.                .Fill.Brush.FillColor.Set 255, 255, 255
  1828.             End With
  1829.       
  1830.             ' Set plot backdrop to gradient
  1831.             With .Plot.Backdrop.Fill
  1832.                .Style = VtFillStyleGradient
  1833.                .Gradient.Style = VtGradientStyleHorizontal
  1834.                .Gradient.FromColor.Set 255, 255, 255
  1835.                .Gradient.ToColor.Set 255, 87, 87
  1836.             End With
  1837.       
  1838.             ' Change the color/fill of the  series
  1839.             With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1)
  1840.                .Brush.Style = VtBrushStylePattern
  1841.                .Brush.Index = VtBrushPattern94Percent
  1842.                .Brush.FillColor.Set 0, 0, 255
  1843.                .Brush.PatternColor.Set 255, 0, 0
  1844.                .EdgePen.Style = VtPenStyleSolid
  1845.                .EdgePen.Width = 2
  1846.                .EdgePen.VtColor.Set 0, 0, 255
  1847.             End With
  1848.       
  1849.          Case 8   'Plot Fill
  1850.             Call QReadData(App.Path + VBARDATA1)
  1851.             .ChartType = VtChChartType2dBar
  1852.       
  1853.             ' Set bar spacing small
  1854.             .Plot.xGap = 0.1
  1855.       
  1856.             'Set plot backdrop
  1857.             With .Plot.Backdrop.Fill
  1858.                .Style = VtFillStyleGradient
  1859.                .Gradient.Style = VtGradientStyleHorizontal
  1860.                .Gradient.FromColor.Set 0, 160, 240
  1861.                .Gradient.ToColor.Set 192, 64, 192
  1862.             End With
  1863.       
  1864.             'Set the chart background
  1865.             .Backdrop.Fill.Style = VtFillStyleBrush
  1866.             .Backdrop.Fill.Brush.Style = VtBrushStyleSolid
  1867.             .Backdrop.Fill.Brush.FillColor.Set 0, 0, 0
  1868.       
  1869.             'Set title frame and backdrop
  1870.             With .Title.Backdrop
  1871.                .Frame.Style = VtFrameStyleThickOuter
  1872.                .Frame.FrameColor.Set 0, 160, 240
  1873.       
  1874.                'Fill the backdrop with solid fill
  1875.                .Fill.Style = VtFillStyleBrush
  1876.                .Fill.Brush.Style = VtBrushStyleSolid
  1877.                .Fill.Brush.FillColor.Set 255, 255, 255
  1878.             End With
  1879.             
  1880.             .Title.VtFont.Size = 16
  1881.             .Title.VtFont.VtColor.Set 0, 0, 255
  1882.       
  1883.          Case 9   'Plot Picture BMP
  1884.             Call QReadData(App.Path + VLINEDATA8)
  1885.             .ChartType = VtChChartType2dLine
  1886.             
  1887.             With .Plot.Backdrop.Fill
  1888.                .Style = VtFillStyleNull
  1889.                .VtPicture.Type = VtPictureTypeBMP
  1890.                .VtPicture.filename = App.Path & VTBMP6
  1891.                .VtPicture.Map = VtPictureMapTypeTiled
  1892.             End With
  1893.             
  1894.             ' Set the pen to create a thick line
  1895.             With .Plot.SeriesCollection.Item(1).Pen
  1896.                .Style = VtPenStyleSolid
  1897.                .Join = VtPenJoinRound
  1898.                .Cap = VtPenCapButt
  1899.                .Width = 8
  1900.             End With
  1901.  
  1902.             With .Plot.SeriesCollection.Item(1).DataPoints
  1903.                For i = 3 To 11
  1904.                   With .Item(i).DataPointLabel
  1905.                      Select Case i
  1906.                         Case 3
  1907.                            .Text = "Carter Elected"
  1908.                            .LocationType = VtChLabelLocationTypeBelowPoint
  1909.                         Case 5
  1910.                            .Text = "Regan Elected"
  1911.                            .LocationType = VtChLabelLocationTypeBelowPoint
  1912.                         Case 9
  1913.                            .Text = "Bush Elected"
  1914.                            .LocationType = VtChLabelLocationTypeAbovePoint
  1915.                         Case 11
  1916.                            .Text = "Clinton Elected"
  1917.                            .LocationType = VtChLabelLocationTypeBelowPoint
  1918.                         Case Else
  1919.                            .Text = ""
  1920.                            .Component = 0
  1921.                            .LineStyle = VtChLabelLineStyleNone
  1922.                            .Custom = False
  1923.                            .VtFont.Size = 8
  1924.                            .VtFont.VtColor.Set 0, 0, 0
  1925.                            With .Backdrop.Frame
  1926.                               .Style = VtFrameStyleThickOuter
  1927.                               .FrameColor.Set 0, 0, 0
  1928.                            End With
  1929.                            With .Backdrop.Fill
  1930.                               .Style = VtFillStyleBrush
  1931.                               .Brush.FillColor.Set 255, 255, 255
  1932.                            End With
  1933.                      End Select
  1934.                   End With
  1935.                Next i
  1936.             End With
  1937.       
  1938.             ' Change the axis grid thickness and color
  1939.             With .Plot.Axis(VtChAxisIdY)
  1940.                .AxisGrid.MinorPen.Width = 3
  1941.                .AxisGrid.MinorPen.VtColor.Set 0, 160, 240
  1942.                .Pen.Width = 3
  1943.                .Pen.VtColor.Set 0, 160, 240
  1944.             End With
  1945.             
  1946.             With .Plot.Axis(VtChAxisIdX)
  1947.                .AxisGrid.MinorPen.Width = 3
  1948.                .AxisGrid.MinorPen.VtColor.Set 0, 160, 240
  1949.                .Pen.Width = 3
  1950.                .Pen.VtColor.Set 0, 160, 240
  1951.             End With
  1952.       
  1953.             ' Change the axis label font size and color
  1954.             Call QSetAxisLabel(VtChAxisIdX, True, 14, 255, 0, 0)
  1955.             Call QSetAxisLabel(VtChAxisIdY, True, 14, 255, 0, 0)
  1956.       
  1957.          Case 10   'Plot Picture WMF
  1958.             Call QReadData(App.Path + VBARDATA1)
  1959.             .ChartType = VtChChartType2dLine
  1960.       
  1961.             ' Smooth the line
  1962.             With .Plot.SeriesCollection.Item(1)
  1963.                .SmoothingFactor = 10
  1964.                .SmoothingType = VtSmoothingTypeQuadraticBSpline
  1965.             End With
  1966.       
  1967.             'Put WMF picture in the backdrop
  1968.             With .Plot.Backdrop.Fill
  1969.                .Style = VtFillStyleNull
  1970.                .VtPicture.filename = App.Path & VTWMF4
  1971.                .VtPicture.Type = VtPictureTypeWMF
  1972.                .VtPicture.Map = VtPictureMapTypeFitted
  1973.             End With
  1974.       
  1975.          Case 11   'Projection Oblique
  1976.             Call QReadData(App.Path + VBARDATA1)
  1977.             .ChartType = VtChChartType3dBar
  1978.       
  1979.             ' Set the width for a more pleasing view
  1980.             .Plot.WidthToHeightRatio = 2
  1981.             .Plot.DepthToHeightRatio = 2
  1982.       
  1983.             ' Set the elevation and rotation
  1984.             Call QSet3DView(0, 17)
  1985.       
  1986.             ' Set Projection
  1987.             .Plot.Projection = VtProjectionTypeOblique
  1988.       
  1989.             ' Set bars to columns
  1990.             .Plot.SeriesCollection.Item(1).Bar.Sides = 32
  1991.             .Plot.SeriesCollection.Item(1).Bar.TopRatio = 1
  1992.       
  1993.             ' Set lighting to upper right corner
  1994.             .Plot.light.LightSources.Remove (-1)
  1995.             ' Set the new light
  1996.             .Plot.light.LightSources.Add -3, -1, 2, 1
  1997.       
  1998.          Case 12   'Projection Perspective
  1999.             Call QReadData(App.Path + VBARDATA1)
  2000.             .ChartType = VtChChartType3dBar
  2001.       
  2002.             ' Set the width for a more pleasing view
  2003.             .Plot.WidthToHeightRatio = 2
  2004.             .Plot.DepthToHeightRatio = 4
  2005.       
  2006.             ' Set the elevation and rotation
  2007.             Call QSet3DView(167, 0)
  2008.       
  2009.             ' Set Projection
  2010.             .Plot.Projection = VtProjectionTypePerspective
  2011.       
  2012.             ' Set Perspective
  2013.             .Plot.Perspective.Set 1, 1, 0.5
  2014.       
  2015.          Case 13 ' Area Highlighted with Line
  2016.             Call QReadData(App.Path + COMBODATA5)
  2017.             .ChartType = VtChChartType2dCombination
  2018.       
  2019.             ' Make sure legend is off
  2020.             .Legend.Location.Visible = False
  2021.       
  2022.             ' Set the title font
  2023.             .Title.VtFont.Size = 16
  2024.             .Title.VtFont.VtColor.Set 208, 47, 139
  2025.       
  2026.             'Change each series
  2027.             .Plot.SeriesCollection.Item(1).seriesType = VtChSeriesType2dLine
  2028.             .Plot.SeriesCollection.Item(2).seriesType = VtChSeriesType2dArea
  2029.       
  2030.             ' Set the pen to create a thick line -- causes illegal operation error
  2031.             With .Plot.SeriesCollection.Item(1).Pen
  2032.                .Style = VtPenStyleSolid
  2033.                .Join = VtPenJoinRound
  2034.                .Cap = VtPenCapRound
  2035.                .Width = 4
  2036.             End With
  2037.       
  2038.             ' Redish
  2039.             Call QSetSeriesColor(1, 208, 47, 139)
  2040.  
  2041.             ' Blueish
  2042.             Call QSetSeriesColor(2, 50, 163, 205)
  2043.       
  2044.             ' Set the chart background to gradient
  2045.             With .Backdrop
  2046.                .Frame.Style = VtFrameStyleSingleLine
  2047.                With .Fill
  2048.                   .Style = VtFillStyleGradient
  2049.                   .Gradient.Style = VtGradientStyleRectangle
  2050.                   .Gradient.FromColor.Set 255, 255, 255
  2051.                   .Gradient.ToColor.Set 192, 192, 192
  2052.                End With
  2053.             End With
  2054.       
  2055.             ' Plot backdrop is null
  2056.             .Plot.Backdrop.Frame.Style = VtFrameStyleNull
  2057.             .Plot.Backdrop.Shadow.Style = VtShadowStyleNull
  2058.             .Plot.Backdrop.Fill.Style = VtFillStyleNull
  2059.       
  2060.          Case 14  ' 3D Stick Charts
  2061.             .ChartType = VtChChartType3dBar
  2062.             Call QReadData(App.Path + VLINEDATA11)
  2063.       
  2064.             ' Set bars to very thin by adjusting the bar gaps
  2065.             .Plot.xGap = 20
  2066.             .Plot.zGap = 20
  2067.       
  2068.             ' Set the elevation and rotation
  2069.             Call QSet3DView(23, 19)
  2070.       
  2071.             ' Set axis grids to null -- major/minor switched ???
  2072.             .Plot.Axis(VtChAxisIdX).AxisGrid.MinorPen.Style = VtPenStyleNull
  2073.             .Plot.Axis(VtChAxisIdY).AxisGrid.MinorPen.Style = VtPenStyleNull
  2074.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MinorPen.Style = VtPenStyleNull
  2075.       
  2076.             ' Set the width for a more pleasing view
  2077.             .Plot.WidthToHeightRatio = 2
  2078.             .Plot.DepthToHeightRatio = 3
  2079.             .Legend.Location.Visible = False
  2080.       
  2081.             ' Turn on markers
  2082.             For Each series In .Plot.SeriesCollection
  2083.                series.ShowLine = False
  2084.                series.SeriesMarker.show = True
  2085.             Next series
  2086.       
  2087.          Case 15  ' 3D bars with no space
  2088.             .ChartType = VtChChartType3dBar
  2089.             Call QReadData(App.Path + VBARDATA12)
  2090.       
  2091.             ' Set bars to very thin by adjusting the bar gaps
  2092.             .Plot.xGap = 0
  2093.             .Plot.zGap = 0
  2094.       
  2095.             ' Set the elevation and rotation
  2096.             Call QSet3DView(23, 19)
  2097.       
  2098.             ' Set the width for a more pleasing view
  2099.             .Plot.WidthToHeightRatio = 2
  2100.             .Plot.DepthToHeightRatio = 2
  2101.       
  2102.             ' Turn the legend off
  2103.             .Legend.Location.Visible = False
  2104.       
  2105.             ' Make all series the same color
  2106.             For i = 1 To .Plot.SeriesCollection.Count
  2107.                Call QSetSeriesColor(i, 255, 64, 64)
  2108.             Next i
  2109.       
  2110.             ' Set base thickness to be real thin
  2111.             ' Turn on walls
  2112.             .Plot.PlotBase.BaseHeight = 0
  2113.       
  2114.             ' Set lighting to upper right corner
  2115.             .Plot.light.LightSources.Remove (-1)
  2116.             ' Set the new light
  2117.             .Plot.light.LightSources.Add 0, -1, 2, 1
  2118.          
  2119.          Case 16
  2120.             Call QReadData(App.Path + COMBODATA7)
  2121.             .ChartType = VtChChartType2dCombination
  2122.       
  2123.             ' Make sure legend is off
  2124.             .Legend.Location.Visible = False
  2125.       
  2126.             'Set the title font
  2127.             .Title.VtFont.Size = 20
  2128.             .Title.VtFont.VtColor.Set 0, 0, 255
  2129.       
  2130.             ' Change each series -- doesn't quite work correctly
  2131.             With .Plot.SeriesCollection
  2132.                .Item(1).seriesType = VtChSeriesType2dLine
  2133.                .Item(2).seriesType = VtChSeriesType2dStep
  2134.                .Item(3).seriesType = VtChSeriesType3dStep
  2135.                .Item(4).seriesType = VtChSeriesType3dStep
  2136.                .Item(5).seriesType = VtChSeriesType3dStep
  2137.                .Item(6).seriesType = VtChSeriesType3dStep
  2138.             End With
  2139.       
  2140.             ' Stack all series on top of series 1
  2141.             With .Plot.SeriesCollection
  2142.                For i = 3 To .Count
  2143.                   With .Item(i).Position
  2144.                      .Excluded = False
  2145.                      .Hidden = False
  2146.                      .Order = 2
  2147.                      .StackOrder = i
  2148.                   End With
  2149.                Next i
  2150.             End With
  2151.       
  2152.             ' Set line to dashed line -- causes illegal instruction error
  2153.             With .Plot.SeriesCollection.Item(1).Pen
  2154.                .Style = VtPenStyleDashed
  2155.                .Join = VtPenJoinMiter
  2156.                .Cap = VtPenCapButt
  2157.                .Width = 4
  2158.             End With
  2159.       
  2160.             ' Change Series Colors
  2161.             Call QSetSeriesColor(1, 0, 0, 112)     ' Blueish
  2162.             Call QSetSeriesColor(2, 255, 0, 0)     ' Red
  2163.             Call QSetSeriesColor(3, 255, 255, 0)   ' Yellow
  2164.             Call QSetSeriesColor(4, 0, 255, 0)     ' Green
  2165.             Call QSetSeriesColor(5, 255, 255, 0)   ' Yellow
  2166.             Call QSetSeriesColor(6, 255, 0, 0)     ' Red
  2167.       
  2168.       End Select
  2169.    End With
  2170. End Sub
  2171.  
  2172. Sub PieChart()
  2173.  
  2174.    Dim series As Object, thedatapoint%
  2175.    
  2176.    Call DefaultChart
  2177.    
  2178.    With frmMain.vtchart1
  2179.       ' Turn off the edge lighting - makes 3D pies look nicer
  2180.       .Plot.light.EdgeVisible = False
  2181.       
  2182.       ' Make X axis fonts larger (X axis is same as individual pie label)
  2183.       Call QSetAxisLabel(VtChAxisIdX, True, 12, 0, 0, 255)
  2184.       
  2185.       Select Case PieIndex
  2186.       
  2187.          Case 0 ' 2D Pie
  2188.             Call QReadData(App.Path + PIEDATA1)
  2189.             .ChartType = VtChChartType2dPie
  2190.       
  2191.          Case 1 ' Multiple Pies
  2192.             Call QReadData(App.Path + PIEDATA2)
  2193.             .ChartType = VtChChartType2dPie
  2194.             ' Change the pie label font
  2195.       
  2196.          Case 2 ' Exploded Pieces
  2197.             Call QReadData(App.Path + PIEDATA1)
  2198.             .ChartType = VtChChartType2dPie
  2199.             For Each series In .Plot.SeriesCollection
  2200.                series.DataPoints.Item(1).Offset = 0.1
  2201.             Next series
  2202.       
  2203.          Case 3 ' Labels
  2204.             Call QReadData(App.Path + PIEDATA1)
  2205.             .ChartType = VtChChartType2dPie
  2206.          
  2207.             For Each series In .Plot.SeriesCollection
  2208.                With series.DataPoints.Item(-1).DataPointLabel
  2209.                   .VtFont.Size = 10
  2210.                   .VtFont.VtColor.Set 0, 0, 255
  2211.                   .LocationType = VtChLabelLocationTypeOutside
  2212.                   .Component = VtChLabelComponentValue
  2213.                   .LineStyle = VtChLabelLineStyleBent
  2214.                   .Custom = False
  2215.                End With
  2216.             Next series
  2217.       
  2218.             ' Pull out a piece
  2219.             .Plot.SeriesCollection.Item(1).DataPoints.Item(1).Offset = 0.2
  2220.       
  2221.          Case 4 ' Weighting
  2222.             Call QReadData(App.Path + PIEDATA3)
  2223.             .ChartType = VtChChartType2dPie
  2224.       
  2225.             ' Turn weighting on
  2226.             .Plot.Weighting.Basis = VtChPieWeightBasisTotal
  2227.             .Plot.Weighting.Style = VtChPieWeightStyleDiameter
  2228.       
  2229.          Case 5 ' Start Angle
  2230.             Call QReadData(App.Path + PIEDATA1)
  2231.             .ChartType = VtChChartType2dPie
  2232.       
  2233.             ' Change the starting angle
  2234.             .Plot.StartingAngle = 0
  2235.       
  2236.             ' Pull out a piece
  2237.             .Plot.SeriesCollection.Item(1).DataPoints.Item(1).Offset = 0.2
  2238.       
  2239.          Case 6 ' Sorting
  2240.             Call QReadData(App.Path + PIEDATA1)
  2241.             .ChartType = VtChChartType2dPie
  2242.       
  2243.             ' Sort in descending order
  2244.             .Plot.Sort = VtSortTypeDescending
  2245.       
  2246.             'Pull out a piece
  2247.             .Plot.SeriesCollection.Item(1).DataPoints.Item(1).Offset = 0.2
  2248.       
  2249.          Case 7 ' 3D Pie
  2250.             Call QReadData(App.Path + PIEDATA1)
  2251.             .ChartType = VtChChartType3dPie
  2252.       
  2253.          Case 8 ' Multiple 3D Pies
  2254.             Call QReadData(App.Path + PIEDATA2)
  2255.             .ChartType = VtChChartType3dPie
  2256.       
  2257.          Case 9 ' Exploded 3D Pieces
  2258.             Call QReadData(App.Path + PIEDATA1)
  2259.             .ChartType = VtChChartType3dPie
  2260.             
  2261.             ' Explode all the pieces
  2262.             For Each series In .Plot.SeriesCollection
  2263.                series.DataPoints.Item(1).Offset = 0.2
  2264.             Next series
  2265.          
  2266.          Case 10 ' Labels
  2267.             Call QReadData(App.Path + PIEDATA1)
  2268.             .ChartType = VtChChartType3dPie
  2269.             
  2270.             ' Label the Points
  2271.             For Each series In .Plot.SeriesCollection
  2272.                With series.DataPoints.Item(-1).DataPointLabel
  2273.                   .VtFont.Size = 10
  2274.                   .VtFont.VtColor.Set 0, 0, 255
  2275.                   .LocationType = VtChLabelLocationTypeOutside
  2276.                   .Component = VtChLabelComponentValue
  2277.                   .LineStyle = VtChLabelLineStyleBent
  2278.                   .Custom = False
  2279.                   .Backdrop.Fill.Style = VtFillStyleBrush
  2280.                   .Backdrop.Fill.Brush.FillColor.Set 255, 128, 128
  2281.                End With
  2282.                series.DataPoints.Item(1).Offset = 0.1
  2283.             Next series
  2284.       
  2285.             ' Set the elevation
  2286.             Call QSet3DView(0, 47)
  2287.       
  2288.          Case 11 ' Thickness
  2289.             Call QReadData(App.Path + PIEDATA1)
  2290.             .ChartType = VtChChartType3dPie
  2291.       
  2292.             ' Make the pie very thick
  2293.             .Plot.Pie.Set 1, 1
  2294.       
  2295.             ' Explode the Pie
  2296.             For Each series In .Plot.SeriesCollection
  2297.                series.DataPoints.Item(1).Offset = 0.2
  2298.             Next series
  2299.       
  2300.          Case 12 ' Thin
  2301.             Call QReadData(App.Path + PIEDATA1)
  2302.             .ChartType = VtChChartType3dPie
  2303.       
  2304.             ' Make the pie very thin
  2305.             .Plot.Pie.Set 0.05, 1
  2306.       
  2307.             ' Set the elevation
  2308.             Call QSet3DView(0, 25)
  2309.       
  2310.             ' Explode the Pie
  2311.             For Each series In .Plot.SeriesCollection
  2312.                series.DataPoints.Item(1).Offset = 0.2
  2313.             Next series
  2314.       
  2315.          Case 13 ' Radius (Cone)
  2316.             Call QReadData(App.Path + PIEDATA1)
  2317.             .ChartType = VtChChartType3dPie
  2318.             .Plot.Pie.Set 1, 0
  2319.       
  2320.       End Select
  2321.    End With
  2322.  
  2323. End Sub
  2324.  
  2325. Sub PolarChart()
  2326.  
  2327.    Call DefaultChart
  2328.    
  2329.    With frmMain.vtchart1
  2330.       ' Set the pen to create a thicker line
  2331.       .Plot.SeriesCollection.Item(1).Pen.Width = 4
  2332.       
  2333.       Select Case PolarIndex
  2334.          Case 0   ' 2D Polar
  2335.             Call QReadData(App.Path + POLARDATA1)
  2336.             .ChartType = VtChChartType2dPolar
  2337.          
  2338.          Case 1   ' 2D Polar No Axis
  2339.             Call QReadData(App.Path + POLARDATA2)
  2340.             .ChartType = VtChChartType2dPolar
  2341.             
  2342.             ' Hide Axis
  2343.             .Plot.Axis(VtChAxisIdY).AxisGrid.MinorPen.Style = VtPenStyleNull
  2344.             .Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
  2345.          
  2346.          Case 2   ' Start Angle
  2347.             Call QReadData(App.Path + POLARDATA3)
  2348.             .ChartType = VtChChartType2dPolar
  2349.             
  2350.             'Change the starting angle
  2351.             .Plot.StartingAngle = 0
  2352.             .Plot.Clockwise = False
  2353.          
  2354.          Case 3   ' Line Styles
  2355.             Call QReadData(App.Path + POLARDATA4)
  2356.             .ChartType = VtChChartType2dPolar
  2357.             
  2358.             ' Set the pen to create a thick line
  2359.             With .Plot.SeriesCollection.Item(1).Pen
  2360.                .Width = 6
  2361.                .Style = VtPenStyleDashDot
  2362.             End With
  2363.             
  2364.       End Select
  2365.    End With
  2366.       
  2367. End Sub
  2368.  
  2369. Sub QGridToChart(rowCount%, colCount%)
  2370.  
  2371.    Dim theRow%, theCol%, TheType%
  2372.    Dim chHandle&, dataValue#
  2373.    Dim grid As Object
  2374.    
  2375.    On Error GoTo 0
  2376.    
  2377.    Set grid = frmData.Grid1
  2378.    
  2379.    With frmMain.vtchart1
  2380.       ' Put Grid Information into Chart
  2381.       ' Set the new title
  2382.       .Title = frmData.TitleBox.Text
  2383.       
  2384.       ' Read the number of rows and columns
  2385.       rowCount = rowCount - 1
  2386.       colCount = colCount - 1
  2387.       .rowCount = rowCount
  2388.       .ColumnCount = colCount
  2389.       .ColumnLabelCount = 1
  2390.       .RowLabelCount = 1
  2391.       
  2392.       ' Set Data Points
  2393.       For theRow = 1 To rowCount
  2394.          .Row = theRow
  2395.          
  2396.          ' Set Row Labels
  2397.          .RowLabelIndex = 0
  2398.          grid.Row = theRow + 1
  2399.          grid.Col = 1
  2400.          .RowLabel = grid.Text
  2401.          
  2402.          For theCol = 1 To colCount
  2403.             .Column = theCol
  2404.             grid.Row = theRow
  2405.             grid.Col = theCol + 1
  2406.             
  2407.             ' Set Column Labels
  2408.             If theRow = 1 Then
  2409.                 .ColumnLabelIndex = 0
  2410.                 .ColumnLabel = grid.Text
  2411.             End If
  2412.             
  2413.             ' Set Data Value
  2414.             grid.Row = theRow + 1
  2415.             grid.Col = theCol + 1
  2416.             .Data = Val(grid.Text)
  2417.          Next theCol
  2418.       Next theRow
  2419.    End With
  2420.  
  2421. End Sub
  2422.  
  2423. Sub QReadData(WorkSheetName As String)
  2424.     
  2425.    Dim theRow%, theCol%
  2426.    Dim gridRow%, gridCol%
  2427.    Dim header$, junk$, theTitle$, theText$
  2428.    
  2429.    On Error Resume Next
  2430.    
  2431.    Screen.MousePointer = 11 'hourglass
  2432.  
  2433.    
  2434.     ' Clear the grid
  2435.     With frmData.Grid1
  2436.        For theRow = 1 To GlobalRowCount + 1
  2437.           For theCol = 1 To GlobalColCount + 1
  2438.              .Row = theRow
  2439.              .Col = theCol
  2440.              .Text = ""
  2441.           Next theCol
  2442.        Next theRow
  2443.     End With
  2444.     
  2445.     ' Read the worksheet
  2446.     GlobalFileName = WorkSheetName
  2447.     
  2448.     Open GlobalFileName For Input As #1
  2449.     If Err Then
  2450.        MsgBox "Can't open file: " + GlobalFileName
  2451.        Exit Sub
  2452.     End If
  2453.     
  2454.     ' Load text file
  2455.     Input #1, header
  2456.     Input #1, junk, theTitle
  2457.     frmData.TitleBox.Text = theTitle
  2458.     Input #1, junk, GlobalRowCount
  2459.     Input #1, junk, GlobalColCount
  2460.     frmData.Text2.Text = Str$(GlobalRowCount) + "," + Str$(GlobalColCount)
  2461.     
  2462.     With frmData.Grid1
  2463.        For theRow = 1 To GlobalRowCount
  2464.           For theCol = 1 To GlobalColCount
  2465.              .ColWidth(theCol) = 1440
  2466.              Input #1, gridRow, gridCol, theText
  2467.              .Row = gridRow
  2468.              .Col = gridCol
  2469.              .Text = theText
  2470.           Next theCol
  2471.        Next theRow
  2472.     End With
  2473.      
  2474.     Close #1
  2475.  
  2476.     'Move the data from the grid to the chart
  2477.     Call QGridToChart(GlobalRowCount, GlobalColCount)
  2478.  
  2479.  
  2480.    Screen.MousePointer = 0 ' Normal mouse pointer
  2481.    
  2482. End Sub
  2483.  
  2484. Function QSet3DView(rotation!, elevation!) As Long
  2485.  
  2486.    With frmMain.vtchart1.Plot.View3d
  2487.       .rotation = rotation
  2488.       .elevation = elevation
  2489.    End With
  2490.    
  2491. End Function
  2492.  
  2493. Function QSetAxisLabel(whichAxis%, ShowAxis%, fontSize%, r%, g%, b%) As Long
  2494.    
  2495.    With frmMain.vtchart1.Plot.Axis(whichAxis)
  2496.       .AxisScale.Hide = Not ShowAxis
  2497.    
  2498.       If ShowAxis Then
  2499.          .Labels.Item(1).VtFont.Size = fontSize
  2500.          .Labels.Item(1).VtFont.VtColor.Set r, g, b
  2501.       End If
  2502.    End With
  2503.  
  2504. End Function
  2505.  
  2506. Sub QSetFootnote(show As Boolean)
  2507.    
  2508.    With frmMain.vtchart1.Footnote
  2509.       If show = True Then
  2510.          'Set the footnote font to yellow
  2511.          .VtFont.Size = 12
  2512.          .VtColor.Set 255, 255, 0
  2513.          
  2514.          'Default footnote backdrop
  2515.          .Backdrop.Fill.VtPicture.filename = ""
  2516.          .Backdrop.Fill.Style = VtFillStyleNull
  2517.          .Backdrop.Frame.Style = VtFrameStyleNull
  2518.          
  2519.          'Set footnote text
  2520.          .Text = "Visual Components, Inc."
  2521.          .Location = VtChLocationTypeBottomLeft
  2522.          .Location.Visible = True
  2523.       Else
  2524.          .Location.Visible = False
  2525.       End If
  2526.    End With
  2527.    
  2528. End Sub
  2529.  
  2530. Function QSetPointColor(series%, dataPoint%, r%, g%, b%) As Long
  2531.  
  2532.    On Error GoTo QSetPointColorError
  2533.    
  2534.    QSetPointColor = 0
  2535.    
  2536.    With frmMain.vtchart1.Plot.SeriesCollection.Item(series).DataPoints.Item(dataPoint)
  2537.       .Brush.Style = VtBrushStyleSolid
  2538.       .Brush.FillColor.Set r, g, b
  2539.       .EdgePen.Style = VtPenStyleSolid
  2540.       .EdgePen.VtColor.Set , r, g, b
  2541.    End With
  2542.    
  2543.    Exit Function
  2544. QSetPointColorError:
  2545.    QSetPointColor = Err.Number
  2546. End Function
  2547.  
  2548. Function QSetSeriesColor(series%, r%, g%, b%) As Long
  2549.  
  2550.    On Error GoTo QSetSeriesColorError
  2551.    
  2552.    QSetSeriesColor = 0
  2553.    
  2554.    With frmMain.vtchart1.Plot.SeriesCollection.Item(series).dataPoint(-1)
  2555.       .Brush.Style = VtBrushStyleSolid
  2556.       .Brush.FillColor.Set r, g, b
  2557.       .EdgePen.Style = VtPenStyleSolid
  2558.       .EdgePen.VtColor.Set , r, g, b
  2559.    End With
  2560.       
  2561.    Exit Function
  2562. QSetSeriesColorError:
  2563.    QSetSeriesColor = Err.Number
  2564. End Function
  2565.  
  2566. Sub QWriteData()
  2567.  
  2568.    Dim theRow%, theCol%
  2569.    Dim gridRow%, gridCol%
  2570.    Dim header$, junk$, theTitle$, theText$
  2571.    Dim cherror&
  2572.    
  2573.    On Error GoTo FileWriteError
  2574.    
  2575.    With frmMain.CommonDialog1
  2576.       .DialogTitle = "Write First Impression Data"
  2577.       .DefaultExt = "vtx"
  2578.       .Filter = "First Impression Data|*.vtx"
  2579.       .flags = &H2
  2580.       .CancelError = True
  2581.       .InitDir = App.Path
  2582.       .ShowSave
  2583.    End With
  2584.    
  2585.    On Error Resume Next
  2586.    
  2587.    Open frmMain.CommonDialog1.filename For Output As #1
  2588.    If Err Then
  2589.       MsgBox "Can't open file: " + frmMain.CommonDialog1.filename
  2590.       Exit Sub
  2591.    End If
  2592.    
  2593.    ' Write text file
  2594.    Write #1, "VisualTools Chart Data"
  2595.    Write #1, "Title", frmMain.vtchart1.Title
  2596.    
  2597.    Write #1, "Rows", frmMain.vtchart1.rowCount + 1
  2598.    Write #1, "Cols", frmMain.vtchart1.ColumnCount + 1
  2599.                       
  2600.     For theRow = 0 To frmMain.vtchart1.rowCount
  2601.         For theCol = 0 To frmMain.vtchart1.ColumnCount
  2602.         
  2603.             If theRow = 0 Then
  2604.                 If theCol = 0 Then
  2605.                     Write #1, theRow + 1, theCol + 1, ""
  2606.                 Else
  2607.                     frmMain.vtchart1.Column = theCol
  2608.                     Write #1, theRow + 1, theCol + 1, frmMain.vtchart1.ColumnLabel
  2609.                 End If
  2610.             Else
  2611.                 If theCol = 0 Then
  2612.                     frmMain.vtchart1.Row = theRow
  2613.                     Write #1, theRow + 1, theCol + 1, frmMain.vtchart1.RowLabel
  2614.                 Else
  2615.                     frmMain.vtchart1.Row = theRow
  2616.                     frmMain.vtchart1.Column = theCol
  2617.                 Write #1, theRow + 1, theCol + 1, Format$(frmMain.vtchart1.Data, "####0.00")
  2618.                 End If
  2619.             End If
  2620.         
  2621.         Next theCol
  2622.     Next theRow
  2623.    
  2624.    Close #1
  2625.    
  2626.    Exit Sub
  2627.  
  2628. FileWriteError:
  2629.    MsgBox Error
  2630.  
  2631. End Sub
  2632.  
  2633. Sub RadarChart()
  2634.    
  2635.    Dim series As Object
  2636.    
  2637.    Call DefaultChart
  2638.    
  2639.    With frmMain.vtchart1
  2640.    
  2641.       Select Case RadarIndex
  2642.    
  2643.          Case 0   ' 2D Radar
  2644.             .ChartType = VtChChartType2dRadar
  2645.             Call QReadData(App.Path + RADARDATA1)
  2646.    
  2647.             ' Set to Lines
  2648.             For Each series In .Plot.SeriesCollection
  2649.                series.seriesType = VtChSeriesType2dRadarLine
  2650.             Next series
  2651.    
  2652.          Case 1   ' 2D Radar No Axis
  2653.             .ChartType = VtChChartType2dRadar
  2654.             Call QReadData(App.Path + RADARDATA1)
  2655.    
  2656.             ' Set to Lines
  2657.             For Each series In .Plot.SeriesCollection
  2658.                series.seriesType = VtChSeriesType2dRadarLine
  2659.             Next series
  2660.    
  2661.             ' Hide Axis
  2662.             .Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
  2663.             .Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
  2664.    
  2665.          Case 2   ' 2D Area Radar
  2666.             .ChartType = VtChChartType2dRadar
  2667.             Call QReadData(App.Path + RADARDATA1)
  2668.             
  2669.             ' Set to areas
  2670.             For Each series In .Plot.SeriesCollection
  2671.                series.seriesType = VtChSeriesType2dRadarArea
  2672.             Next series
  2673.       
  2674.       End Select
  2675.    End With
  2676. End Sub
  2677.  
  2678. Sub StepChart()
  2679.  
  2680.    Dim series As Object, i%
  2681.    
  2682.    Call DefaultChart
  2683.  
  2684.    With frmMain.vtchart1
  2685.       Select Case StepIndex
  2686.  
  2687.          Case 0   ' 2D Step
  2688.             .ChartType = VtChChartType2dStep
  2689.             Call QReadData(App.Path + VAREADATA1)
  2690.  
  2691.          Case 1   ' Stacked Step
  2692.             .ChartType = VtChChartType2dStep
  2693.             Call QReadData(App.Path + VAREADATA1)
  2694.  
  2695.             ' Stack all series on top of series 1
  2696.             With .Plot.SeriesCollection
  2697.                For i = 2 To .Count
  2698.                   With .Item(i).Position
  2699.                      .Excluded = False
  2700.                      .Hidden = False
  2701.                      .Order = 1
  2702.                      .StackOrder = i
  2703.                   End With
  2704.                Next i
  2705.             End With
  2706.       
  2707.          Case 2  ' 3D Step
  2708.             .ChartType = VtChChartType3dStep
  2709.             Call QReadData(App.Path + VAREADATA1)
  2710.  
  2711.             ' Set the width for a more pleasing view
  2712.             .Plot.WidthToHeightRatio = 2
  2713.             .Plot.DepthToHeightRatio = 3
  2714.             .Legend.Location.Visible = False
  2715.  
  2716.          Case 3  ' 3D Labeled
  2717.             .ChartType = VtChChartType3dStep
  2718.             Call QReadData(App.Path + VLINEDATA4)
  2719.  
  2720.             ' Set the width for a more pleasing view
  2721.             .Plot.WidthToHeightRatio = 2
  2722.             .Plot.DepthToHeightRatio = 3
  2723.             .Legend.Location.Visible = False
  2724.  
  2725.             ' Set the elevation and rotation
  2726.             Call QSet3DView(68, 14)
  2727.  
  2728.             ' Label the Points
  2729.             For Each series In .Plot.SeriesCollection
  2730.                With series.DataPoints.Item(-1).DataPointLabel
  2731.                   .LocationType = VtChLabelLocationTypeAbovePoint
  2732.                   .Component = VtChLabelComponentValue
  2733.                   .LineStyle = VtChLabelLineStyleNone
  2734.                   .Custom = False
  2735.             
  2736.                   ' Make the labels larger and change color
  2737.                   .VtFont.Size = 12
  2738.                   .VtFont.VtColor.Set 0, 0, 255
  2739.                End With
  2740.             Next series
  2741.  
  2742.             ' Set Y axis scale
  2743.             With .Plot.Axis(VtChAxisIdY).ValueScale
  2744.                .Auto = False
  2745.                .Maximum = 125
  2746.                .Minimum = 100
  2747.                .MajorDivision = 5
  2748.                .MinorDivision = 1
  2749.             End With
  2750.  
  2751.             ' Turn off Z axis
  2752.             Call QSetAxisLabel(VtChAxisIdZ, False, 14, 0, 0, 202)
  2753.  
  2754.          Case 4  ' 3D Wide Step
  2755.             .ChartType = VtChChartType3dStep
  2756.             Call QReadData(App.Path + VAREADATA1)
  2757.  
  2758.             ' Set the width for a more pleasing view
  2759.             .Plot.WidthToHeightRatio = 2
  2760.             .Plot.DepthToHeightRatio = 10
  2761.             .Legend.Location.Visible = False
  2762.  
  2763.       End Select
  2764.    End With
  2765. End Sub
  2766.  
  2767. Sub SurfaceChart()
  2768.  
  2769.     Dim series As Object, i%
  2770.     Dim ContourGradient As Object
  2771.  
  2772.     
  2773.     Call DefaultChart
  2774.    
  2775.     With frmMain.vtchart1
  2776.         ' Turn off axis
  2777.         Call QSetAxisLabel(VtChAxisIdX, False, 16, 0, 0, 255)
  2778.         Call QSetAxisLabel(VtChAxisIdY, False, 16, 0, 0, 255)
  2779.         Call QSetAxisLabel(VtChAxisIdY2, False, 16, 0, 0, 255)
  2780.         Call QSetAxisLabel(VtChAxisIdZ, False, 16, 0, 0, 255)
  2781.         
  2782.         ' Turn off Y, Y2 grids
  2783.         .Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen.Style = VtPenStyleNull
  2784.         .Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
  2785.         .Plot.Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
  2786.         .Plot.Axis(VtChAxisIdZ).AxisGrid.MajorPen.Style = VtPenStyleNull
  2787.   
  2788.       Select Case SChartIndex
  2789.          Case 0   ' 2D Countour lines
  2790.             .ChartType = VtChChartType2dContour
  2791.             Call QReadData(App.Path + CONTOUR1)
  2792.             
  2793.             ' Smooth the data
  2794.             .Plot.elevation.ColSmoothing = 2
  2795.             .Plot.elevation.RowSmoothing = 2
  2796.             
  2797.             ' Turn on Lines
  2798.             .Plot.elevation.Contour.DisplayType = VtChContourDisplayTypeCLines
  2799.             
  2800.            
  2801.          Case 1   ' 2D Countour bands
  2802.             .ChartType = VtChChartType2dContour
  2803.             Call QReadData(App.Path + CONTOUR1)
  2804.             
  2805.             ' Smooth the data
  2806.             .Plot.elevation.ColSmoothing = 2
  2807.             .Plot.elevation.RowSmoothing = 2
  2808.          
  2809.          
  2810.          Case 2, 3   ' 3D Surface
  2811.             .ChartType = VtChChartType3dSurface
  2812.             Call QReadData(App.Path + SURFACE1)
  2813.             
  2814.             ' Set the width for a more pleasing view
  2815.             .Plot.WidthToHeightRatio = 2
  2816.             .Plot.DepthToHeightRatio = 2
  2817.             
  2818.             ' Set the elevation and rotation
  2819.             Call QSet3DView(306, 20)
  2820.  
  2821.             ' Turn the legend off
  2822.             .Legend.Location.Visible = False
  2823.             
  2824.             'Set the title font
  2825.             .Title.VtFont.Size = 16
  2826.             .Title.VtFont.VtColor.Set 255, 255, 255
  2827.             
  2828.             'Set Footnote
  2829.             .Footnote.Text = "Geological Surveyors, Inc."
  2830.             .Footnote.VtFont.Size = 8
  2831.  
  2832.             ' Set the chart background to gradient
  2833.             With .Backdrop
  2834.                .Frame.Style = VtFrameStyleSingleLine
  2835.                .Fill.Style = VtFillStyleGradient
  2836.                With .Fill.Gradient
  2837.                   .Style = VtGradientStyleHorizontal
  2838.                   .FromColor.Set 108, 108, 255
  2839.                   .ToColor.Set 255, 255, 255
  2840.                End With
  2841.             End With
  2842.             
  2843.             ' Plot Backdrop is Null
  2844.             .Plot.Backdrop.Frame.Style = VtFrameStyleNull
  2845.             .Plot.Backdrop.Shadow.Style = VtShadowStyleNull
  2846.             .Plot.Backdrop.Fill.Style = VtFillStyleNull
  2847.             
  2848.             ' Set Pedestal color to gray
  2849.             .Plot.PlotBase.Brush.FillColor.Set 176, 176, 176
  2850.             
  2851.             ' Set walls and floor color depending on chart
  2852.             If SChartIndex = 2 Then
  2853.                 ' Turn off walls
  2854.                 .Plot.Wall.Pen.Style = VtPenStyleNull
  2855.             
  2856.                 ' Make floor invisible and change grid colors
  2857.                 With .Plot.PlotBase
  2858.                    .BaseHeight = 0
  2859.                    .Brush.Style = VtBrushStyleNull
  2860.                    .Pen.Width = 0
  2861.                    .Pen.Style = VtPenStyleNull
  2862.                 End With
  2863.             End If
  2864.                        
  2865.             'Set Y axis scale
  2866.             '' If maximum > minimum, the maximum MUST be set first
  2867.             '' This is important because even though we aren't going to show
  2868.             '' the axis, the number of divisions determines the number of
  2869.             '' contour bands.
  2870.             With .Plot.Axis(VtChAxisIdY).ValueScale
  2871.                .Auto = False
  2872.                .Maximum = 50
  2873.                .Minimum = -50
  2874.                .MajorDivision = 10
  2875.                .MinorDivision = 1
  2876.             End With
  2877.             
  2878.             ' Set surface to solid
  2879.             .Plot.elevation.Surface.DisplayType = VtChSurfaceDisplayTypeSolid
  2880.             .Plot.elevation.Surface.RowWireframe = VtChSurfaceWireframeTypeNone
  2881.             .Plot.elevation.Surface.ColWireframe = VtChSurfaceWireframeTypeNone
  2882.  
  2883.             ' Set Surface color
  2884.             .Plot.elevation.Surface.Brush.Style = VtBrushStyleSolid
  2885.             .Plot.elevation.Surface.Brush.FillColor.Set 10, 128, 10
  2886.            
  2887.             ' Set base to bands or pedestal
  2888.             If SChartIndex = 2 Then
  2889.                 .Plot.elevation.Surface.Base = VtChSurfaceBaseTypeStandardWithCBands
  2890.             Else
  2891.                 .Plot.elevation.Surface.Base = VtChSurfaceBaseTypePedestal
  2892.             End If
  2893.             
  2894.             ' Set upper projection to lines
  2895.             .Plot.elevation.Surface.Projection = VtChSurfaceProjectionTypeCLines
  2896.             
  2897.             '' Turn on the auto values
  2898.             .Plot.elevation.AutoValues = True
  2899.  
  2900.             '' Set the surface chart color type to gradient
  2901.             .Plot.elevation.ColorType = VtChContourColorTypeGradient
  2902.             
  2903.             '' Change the from color and to color
  2904.             Set ContourGradient = .Plot.elevation.ContourGradient
  2905.             ContourGradient.FromBrushColor.Set 255, 0, 0
  2906.             ContourGradient.ToBrushColor.Set 255, 255, 0
  2907.             
  2908.          Case 4   ' 3D Surface with contours
  2909.             .ChartType = VtChChartType3dSurface
  2910.             Call QReadData(App.Path + SURFACE1)
  2911.             
  2912.             ' Set the width for a more pleasing view
  2913.             .Plot.WidthToHeightRatio = 2
  2914.             .Plot.DepthToHeightRatio = 2
  2915.             
  2916.             ' Set the elevation and rotation
  2917.             Call QSet3DView(306, 20)
  2918.  
  2919.             'Set the title font
  2920.             .Title.VtFont.Size = 16
  2921.             .Title.VtFont.VtColor.Set 255, 255, 255
  2922.             
  2923.             'Set Footnote
  2924.             .Footnote.Text = "Geological Surveyors, Inc."
  2925.             .Footnote.VtFont.Size = 8
  2926.  
  2927.             ' Set the chart background to gradient
  2928.             With .Backdrop
  2929.                .Frame.Style = VtFrameStyleSingleLine
  2930.                .Fill.Style = VtFillStyleGradient
  2931.                With .Fill.Gradient
  2932.                   .Style = VtGradientStyleHorizontal
  2933.                   .FromColor.Set 108, 108, 255
  2934.                   .ToColor.Set 255, 255, 255
  2935.                End With
  2936.             End With
  2937.             
  2938.             ' Plot Backdrop is Null
  2939.             .Plot.Backdrop.Frame.Style = VtFrameStyleNull
  2940.             .Plot.Backdrop.Shadow.Style = VtShadowStyleNull
  2941.             .Plot.Backdrop.Fill.Style = VtFillStyleNull
  2942.             
  2943.             'Set Y axis scale
  2944.             '' If maximum > minimum, the maximum MUST be set first
  2945.             '' This is important because even though we aren't going to show
  2946.             '' the axis, the number of divisions determines the number of
  2947.             '' contour bands.
  2948.             With .Plot.Axis(VtChAxisIdY).ValueScale
  2949.                .Auto = False
  2950.                .Maximum = 30
  2951.                .Minimum = -30
  2952.                .MajorDivision = 6
  2953.                .MinorDivision = 1
  2954.             End With
  2955.             
  2956.             ' Set Pedestal color to gray
  2957.             .Plot.PlotBase.Brush.FillColor.Set 176, 176, 176
  2958.             
  2959.             ' Set surface to bands
  2960.             .Plot.elevation.Surface.DisplayType = VtChSurfaceDisplayTypeCBands
  2961.             .Plot.elevation.Surface.RowWireframe = VtChSurfaceWireframeTypeNone
  2962.             .Plot.elevation.Surface.ColWireframe = VtChSurfaceWireframeTypeNone
  2963.  
  2964.             ' Put in Pedestal for base
  2965.             .Plot.elevation.Surface.Base = VtChSurfaceBaseTypePedestal
  2966.             
  2967.             '' Turn on the auto values
  2968.             .Plot.elevation.AutoValues = True
  2969.  
  2970.          Case 5   ' 3D Surface Wireframe
  2971.             .ChartType = VtChChartType3dSurface
  2972.             Call QReadData(App.Path + SURFACE1)
  2973.             
  2974.             ' Smooth the data
  2975.             .Plot.elevation.ColSmoothing = 2
  2976.             .Plot.elevation.RowSmoothing = 2
  2977.             
  2978.             ' Set the width for a more pleasing view
  2979.             .Plot.WidthToHeightRatio = 2
  2980.             .Plot.DepthToHeightRatio = 2
  2981.             
  2982.             ' Set the elevation and rotation
  2983.             Call QSet3DView(306, 20)
  2984.  
  2985.             ' Turn the legend off
  2986.             .Legend.Location.Visible = False
  2987.             
  2988.             'Set the title font
  2989.             .Title.VtFont.Size = 16
  2990.             .Title.VtFont.VtColor.Set 255, 255, 255
  2991.             
  2992.             'Set Footnote
  2993.             .Footnote.Text = "Geological Surveyors, Inc."
  2994.             .Footnote.VtFont.Size = 8
  2995.  
  2996.             ' Set the chart background to gradient
  2997.             With .Backdrop
  2998.                .Frame.Style = VtFrameStyleSingleLine
  2999.                .Fill.Style = VtFillStyleGradient
  3000.                With .Fill.Gradient
  3001.                   .Style = VtGradientStyleHorizontal
  3002.                   .FromColor.Set 108, 108, 255
  3003.                   .ToColor.Set 255, 255, 255
  3004.                End With
  3005.             End With
  3006.             
  3007.             ' Plot Backdrop is Null
  3008.             .Plot.Backdrop.Frame.Style = VtFrameStyleNull
  3009.             .Plot.Backdrop.Shadow.Style = VtShadowStyleNull
  3010.             .Plot.Backdrop.Fill.Style = VtFillStyleNull
  3011.             
  3012.             'Set Y axis scale
  3013.             '' If maximum > minimum, the maximum MUST be set first
  3014.             '' This is important because even though we aren't going to show
  3015.             '' the axis, the number of divisions determines the number of
  3016.             '' contour bands.
  3017.             With .Plot.Axis(VtChAxisIdY).ValueScale
  3018.                .Auto = False
  3019.                .Maximum = 30
  3020.                .Minimum = -30
  3021.                .MajorDivision = 6
  3022.                .MinorDivision = 1
  3023.             End With
  3024.             
  3025.             ' Turn on walls
  3026.             .Plot.Wall.Width = 0
  3027.             .Plot.Wall.Brush.Style = VtBrushStyleSolid
  3028.             
  3029.             ' Set surface to Wireframe
  3030.             .Plot.elevation.Surface.DisplayType = VtChSurfaceDisplayTypeNone
  3031.             .Plot.elevation.Surface.RowWireframe = VtChSurfaceWireframeTypeMajor
  3032.             .Plot.elevation.Surface.ColWireframe = VtChSurfaceWireframeTypeMajor
  3033.             .Plot.elevation.Surface.WireframePen.VtColor.Set 255, 0, 0
  3034.  
  3035.             ' Put in Standard base
  3036.             .Plot.elevation.Surface.Base = VtChSurfaceBaseTypeStandard
  3037.             
  3038.             '' Turn on the auto values
  3039.             .Plot.elevation.AutoValues = True
  3040.             
  3041.        End Select
  3042.    End With
  3043.  
  3044. End Sub
  3045.  
  3046. Sub VBarChart()
  3047.  
  3048.    Dim series As Object, dataPoint As Object, i%
  3049.    
  3050.    ' Reset all chart options
  3051.    Call DefaultChart
  3052.    
  3053.    With frmMain.vtchart1
  3054.       Select Case VBarIndex
  3055.         
  3056.          Case 0   'Default Chart
  3057.             Call QReadData(App.Path + VBARDATA1)
  3058.             .ChartType = VtChChartType2dBar
  3059.        
  3060.          Case 1   ' Labeled Bars
  3061.             .ChartType = VtChChartType2dBar
  3062.             Call QReadData(App.Path + VBARDATA7)
  3063.             
  3064.             '' Format the data point labels
  3065.             For Each series In .Plot.SeriesCollection
  3066.                With series.DataPoints.Item(-1).DataPointLabel
  3067.                   ' Label the Point
  3068.                   .LocationType = VtChLabelLocationTypeAbovePoint
  3069.                   .Component = VtChLabelComponentValue
  3070.                   .LineStyle = VtChLabelLineStyleNone
  3071.                   .Custom = False
  3072.             
  3073.                   ' Make the labels larger and change color
  3074.                   .VtFont.Size = 14
  3075.                   .VtFont.VtColor.Set 255, 0, 0
  3076.                End With
  3077.             Next series
  3078.             
  3079.             ' Change the color of the 1st series
  3080.             Call QSetSeriesColor(1, 0, 0, 255)
  3081.  
  3082.          Case 2   ' +/- Data
  3083.             .ChartType = VtChChartType2dBar
  3084.             Call QReadData(App.Path + VBARDATA2)
  3085.          
  3086.          Case 3   ' Tiled Picture Bars
  3087.             Call QReadData(App.Path + VBARDATA23)
  3088.             .ChartType = VtChChartType2dBar
  3089.             
  3090.             For i = 1 To .Plot.SeriesCollection.Count
  3091.                With .Plot.SeriesCollection.Item(i).DataPoints.Item(-1).VtPicture
  3092.                   .Type = VtPictureTypeWMF
  3093.                   .Map = VtPictureMapTypeTiled
  3094.                   .Embedded = 0
  3095.                   If i = 1 Then
  3096.                      .filename = App.Path + VTWMF1
  3097.                   ElseIf i = 2 Then
  3098.                      .filename = App.Path + VTWMF2
  3099.                   Else
  3100.                      .filename = App.Path + VTWMF3
  3101.                   End If
  3102.                End With
  3103.             Next i
  3104.  
  3105.         Case 4   ' Stretched Pictures
  3106.             Call QReadData(App.Path + VBARDATA1)
  3107.             .ChartType = VtChChartType2dBar
  3108.             
  3109.             ' Put a picture in each bar
  3110.             For Each series In .Plot.SeriesCollection
  3111.                With series.DataPoints.Item(-1).VtPicture
  3112.                   .Type = VtPictureTypeWMF
  3113.                   .Map = VtPictureMapTypeStretched
  3114.                   .Embedded = 0
  3115.                   .filename = App.Path & VTWMF4
  3116.                End With
  3117.             Next series
  3118.         
  3119.         Case 5   ' Stacked
  3120.             Call QReadData(App.Path + VBARDATA4)
  3121.             .ChartType = VtChChartType2dBar
  3122.     
  3123.             ' Stack all series on top of series 1
  3124.             With .Plot.SeriesCollection
  3125.                For i = 2 To .Count
  3126.                   With .Item(i).Position
  3127.                      .Excluded = False
  3128.                      .Hidden = False
  3129.                      .Order = 1
  3130.                      .StackOrder = i
  3131.                   End With
  3132.                Next i
  3133.             End With
  3134.         
  3135.         Case 6   ' Stacked Percent
  3136.             Call QReadData(App.Path + VBARDATA5)
  3137.             .ChartType = VtChChartType2dBar
  3138.             
  3139.             ' Stack all series on top of series 1
  3140.             With .Plot.SeriesCollection
  3141.                For i = 2 To .Count
  3142.                    With .Item(i).Position
  3143.                      .Excluded = False
  3144.                      .Hidden = False
  3145.                      .Order = 1
  3146.                      .StackOrder = i
  3147.                   End With
  3148.                Next i
  3149.             End With
  3150.             
  3151.             ' Set axis to percent scaling
  3152.             .Plot.Axis(VtChAxisIdY).AxisScale.PercentBasis = VtChPercentAxisBasisSumRow
  3153.             .Plot.Axis(VtChAxisIdY).AxisScale.Type = VtChScaleTypePercent
  3154.         
  3155.         Case 7   ' 3D Default
  3156.             Call QReadData(App.Path + VBARDATA1)
  3157.             .ChartType = VtChChartType3dBar
  3158.             
  3159.             ' Set the width for a more pleasing view
  3160.             .Plot.WidthToHeightRatio = 2
  3161.             .Plot.DepthToHeightRatio = 2
  3162.             
  3163.             ' Set the elevation and rotation
  3164.             Call QSet3DView(76, 26)
  3165.  
  3166.             ' Turn the legend off
  3167.             .Legend.Location.Visible = False
  3168.             
  3169.             ' Change Bar Colors
  3170.             Call QSetPointColor(1, 2, 128, 0, 128) ' purple
  3171.             Call QSetPointColor(1, 3, 0, 160, 240) ' Blue
  3172.             Call QSetPointColor(1, 4, 255, 35, 170) ' Pink
  3173.             Call QSetPointColor(1, 5, 255, 255, 0) ' Yellow
  3174.             
  3175.             ' Make X axis 14 point Blue
  3176.             Call QSetAxisLabel(VtChAxisIdX, True, 14, 0, 0, 255)
  3177.             
  3178.             ' Make Y and Y2 axis 12 point Blue
  3179.             Call QSetAxisLabel(VtChAxisIdY, True, 12, 0, 0, 255)
  3180.             Call QSetAxisLabel(VtChAxisIdY2, True, 12, 0, 0, 255)
  3181.         
  3182.             ' Turn Z axis off
  3183.             Call QSetAxisLabel(VtChAxisIdZ, False, 12, 0, 0, 255)
  3184.         
  3185.         Case 8   ' 3D Labeled
  3186.             Call QReadData(App.Path + VBARDATA9)
  3187.             .ChartType = VtChChartType3dBar
  3188.  
  3189.             ' Set the width for a more pleasing view
  3190.             .Plot.WidthToHeightRatio = 2
  3191.             .Plot.DepthToHeightRatio = 2
  3192.             
  3193.             ' Set the elevation and rotation
  3194.             Call QSet3DView(80, 21)
  3195.             
  3196.             ' Turn the legend off
  3197.             .Legend.Location.Visible = False
  3198.         
  3199.             '' Do all at once
  3200.             With .Plot.SeriesCollection.Item(1).DataPoints.Item(-1).DataPointLabel
  3201.                .LocationType = VtChLabelLocationTypeAbovePoint
  3202.                .Component = 1
  3203.                .LineStyle = VtChLabelLineStyleNone
  3204.                .Custom = False
  3205.                .VtFont.Size = 14
  3206.                .VtFont.VtColor.Set 255, 35, 170
  3207.             End With
  3208.    
  3209.             ' Set the bars to cones
  3210.             For Each series In .Plot.SeriesCollection
  3211.                series.Bar.Sides = 16
  3212.                series.Bar.TopRatio = 0
  3213.             Next series
  3214.             
  3215.             ' Make X axis 16 point Blue
  3216.             Call QSetAxisLabel(VtChAxisIdX, True, 16, 0, 0, 255)
  3217.             
  3218.             ' Make Y and Y2 axis 12 point Blue
  3219.             Call QSetAxisLabel(VtChAxisIdY, True, 12, 0, 0, 255)
  3220.             Call QSetAxisLabel(VtChAxisIdY2, True, 12, 0, 0, 255)
  3221.         
  3222.             ' Turn Z axis off
  3223.             Call QSetAxisLabel(VtChAxisIdZ, False, 12, 0, 0, 255)
  3224.             
  3225.             ' Stand the X axis labels up
  3226.             .Plot.Axis(VtChAxisIdX).Labels.Item(1).Standing = True
  3227.         
  3228.         Case 9   ' 3D Bar Styles
  3229.             Call QReadData(App.Path + VBARDATA10)
  3230.             .ChartType = VtChChartType3dBar
  3231.             
  3232.             ' Set the width for a more pleasing view
  3233.             .Plot.WidthToHeightRatio = 2
  3234.             .Plot.DepthToHeightRatio = 2
  3235.             
  3236.             'Turn legend off
  3237.             .Legend.Location.Visible = False
  3238.             
  3239.             'Set bar shapes to cylinder, pyramid, pentagon
  3240.             With .Plot.SeriesCollection
  3241.                For i = 1 To .Count
  3242.                   .Item(i).Bar.TopRatio = 1
  3243.                   Select Case i
  3244.                      Case 1
  3245.                         .Item(i).Bar.Sides = 3
  3246.                      Case 2
  3247.                         .Item(i).Bar.Sides = 4
  3248.                      Case 3
  3249.                         .Item(i).Bar.Sides = 5
  3250.                      Case 4
  3251.                         .Item(i).Bar.Sides = 8
  3252.                      Case Else
  3253.                         .Item(i).Bar.Sides = 32
  3254.                   End Select
  3255.                Next i
  3256.             End With
  3257.             
  3258.             ' Set the elevation and rotation
  3259.             Call QSet3DView(37, 14)
  3260.             
  3261.             ' Turn off Axis
  3262.             Call QSetAxisLabel(VtChAxisIdX, False, 16, 0, 0, 255)
  3263.             Call QSetAxisLabel(VtChAxisIdZ, False, 16, 0, 0, 255)
  3264.             Call QSetAxisLabel(VtChAxisIdY, False, 16, 0, 0, 255)
  3265.             Call QSetAxisLabel(VtChAxisIdY2, False, 16, 0, 0, 255)
  3266.         
  3267.             ' Turn off Y, Y2 grids
  3268.             .Plot.Axis(VtChAxisIdY).AxisGrid.MajorPen.Style = VtPenStyleNull
  3269.             .Plot.Axis(VtChAxisIdY).AxisGrid.MinorPen.Style = VtPenStyleNull
  3270.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MajorPen.Style = VtPenStyleNull
  3271.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MinorPen.Style = VtPenStyleNull
  3272.         
  3273.             ' Set X and Z grids to a color
  3274.             With .Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen
  3275.                .Width = 3
  3276.                .VtColor.Set 0, 128, 192
  3277.             End With
  3278.             
  3279.             With .Plot.Axis(VtChAxisIdZ).AxisGrid.MajorPen
  3280.                .Width = 3
  3281.                .VtColor.Set 0, 128, 192
  3282.             End With
  3283.             
  3284.             ' Turn off walls
  3285.             .Plot.Wall.Pen.Style = VtPenStyleNull
  3286.             
  3287.             ' Make floor invisible and change grid colors
  3288.             With .Plot.PlotBase
  3289.                .BaseHeight = 0
  3290.                .Brush.Style = VtBrushStyleNull
  3291.                .Pen.Width = 0
  3292.                .Pen.VtColor.Set 0, 128, 192
  3293.             End With
  3294.             
  3295.          Case 10  ' 3D With Walls
  3296.             Call QReadData(App.Path + VBARDATA8)
  3297.             .ChartType = VtChChartType3dBar
  3298.             
  3299.             ' Set the width for a more pleasing view
  3300.             .Plot.WidthToHeightRatio = 2
  3301.             .Plot.DepthToHeightRatio = 2
  3302.             
  3303.             'Turn the legend off
  3304.             .Legend.Location.Visible = False
  3305.             
  3306.             ' Turn on walls
  3307.             .Plot.Wall.Width = 20
  3308.             .Plot.Wall.Brush.Style = VtBrushStyleSolid
  3309.             
  3310.             ' Set bars to columns
  3311.             For Each series In .Plot.SeriesCollection
  3312.                series.Bar.TopRatio = 1
  3313.                series.Bar.Sides = 16
  3314.             Next series
  3315.             
  3316.             ' Set the elevation and rotation
  3317.             Call QSet3DView(7, 42)
  3318.  
  3319.             ' Turn off X and Z axis, Turn on Y and Y2
  3320.             Call QSetAxisLabel(VtChAxisIdX, False, 16, 0, 0, 255)
  3321.             Call QSetAxisLabel(VtChAxisIdZ, False, 16, 0, 0, 255)
  3322.             Call QSetAxisLabel(VtChAxisIdY, True, 16, 0, 0, 255)
  3323.             Call QSetAxisLabel(VtChAxisIdY2, True, 16, 0, 0, 255)
  3324.             
  3325.         Case 11  ' 3D Clustered
  3326.             Call QReadData(App.Path + VBARDATA6)
  3327.             .ChartType = VtChChartType3dClusteredBar
  3328.             
  3329.            ' Set the width for a more pleasing view
  3330.             .Plot.WidthToHeightRatio = 3
  3331.             .Plot.DepthToHeightRatio = 2
  3332.  
  3333.             'Turn the legend off
  3334.             .Legend.Location.Visible = False
  3335.  
  3336.             ' Set bars to columns
  3337.             For Each series In .Plot.SeriesCollection
  3338.                series.Bar.TopRatio = 1
  3339.                series.Bar.Sides = 16
  3340.             Next series
  3341.     
  3342.             ' Set the elevation and rotation
  3343.             Call QSet3DView(79, 36)
  3344.     
  3345.             ' Make the axis fonts larger and change color
  3346.             Call QSetAxisLabel(VtChAxisIdX, True, 18, 0, 0, 202)
  3347.             Call QSetAxisLabel(VtChAxisIdY, True, 12, 0, 0, 202)
  3348.             Call QSetAxisLabel(VtChAxisIdY2, True, 12, 0, 0, 202)
  3349.         
  3350.         Case 12 ' +/- 3D Bars
  3351.             Call QReadData(App.Path + VBARDATA18)
  3352.             .ChartType = VtChChartType3dBar
  3353.            ' Set the width for a more pleasing view
  3354.             .Plot.WidthToHeightRatio = 2
  3355.             .Plot.DepthToHeightRatio = 2
  3356.  
  3357.             'Turn the legend off
  3358.             .Legend.Location.Visible = False
  3359.  
  3360.             ' Set bars to columns
  3361.             For Each series In .Plot.SeriesCollection
  3362.                series.Bar.TopRatio = 1
  3363.                series.Bar.Sides = 32
  3364.             Next series
  3365.             
  3366.             ' Set the elevation and rotation
  3367.             Call QSet3DView(37, 14)
  3368.             
  3369.             ' Turn off Axis
  3370.             Call QSetAxisLabel(VtChAxisIdX, False, 16, 0, 0, 255)
  3371.             Call QSetAxisLabel(VtChAxisIdZ, False, 16, 0, 0, 255)
  3372.             Call QSetAxisLabel(VtChAxisIdY, False, 16, 0, 0, 255)
  3373.             Call QSetAxisLabel(VtChAxisIdY2, False, 16, 0, 0, 255)
  3374.         
  3375.             ' Turn off Y, Y2 grids
  3376.             .Plot.Axis(VtChAxisIdY).AxisGrid.MinorPen.Style = VtPenStyleNull
  3377.             .Plot.Axis(VtChAxisIdY2).AxisGrid.MinorPen.Style = VtPenStyleNull
  3378.             
  3379.             ' Set X and Z grids to a color
  3380.             With .Plot.Axis(VtChAxisIdX).AxisGrid.MajorPen
  3381.                .Width = 3
  3382.                .VtColor.Set 0, 128, 192
  3383.             End With
  3384.             
  3385.             With .Plot.Axis(VtChAxisIdZ).AxisGrid.MajorPen
  3386.                .Width = 3
  3387.                .VtColor.Set 0, 128, 192
  3388.             End With
  3389.             
  3390.             ' Turn off walls
  3391.             .Plot.Wall.Pen.Style = VtPenStyleNull
  3392.             
  3393.             ' Make floor invisible and change grid colors
  3394.             With .Plot.PlotBase
  3395.                .BaseHeight = 0
  3396.                .Brush.Style = VtBrushStyleNull
  3397.                .Pen.Width = 0
  3398.                .Pen.VtColor.Set 0, 128, 192
  3399.             End With
  3400.             
  3401.       End Select
  3402.    End With
  3403.  
  3404. End Sub
  3405.  
  3406. Sub XYChart()
  3407.    
  3408.    Dim series As Object, dataPoint As Object
  3409.    
  3410.    Call DefaultChart
  3411.    
  3412.    With frmMain.vtchart1
  3413.    
  3414.       Select Case XYIndex
  3415.       
  3416.          Case 0 ' Default XY
  3417.             Call QReadData(App.Path + XYDATA1)
  3418.             .ChartType = VtChChartType2dXY
  3419.             With .Plot.Axis(VtChAxisIdY).ValueScale
  3420.                .Auto = False
  3421.                .Maximum = 0.5
  3422.                .Minimum = -0.2
  3423.             End With
  3424.             
  3425.             '' Allow scale on x and y to be different
  3426.             .Plot.UniformAxis = False
  3427.             
  3428.          Case 1 ' Markers
  3429.             Call QReadData(App.Path + XYDATA2)
  3430.             .ChartType = VtChChartType2dXY
  3431.       
  3432.             ' Turn on markers
  3433.             For Each series In .Plot.SeriesCollection
  3434.                series.SeriesMarker.show = True
  3435.                series.ShowLine = False
  3436.             Next series
  3437.             
  3438.             '' Allow scale on x and y to be different
  3439.             .Plot.UniformAxis = False
  3440.         
  3441.          Case 2 ' Picture Markers
  3442.             Call QReadData(App.Path + XYDATA3)
  3443.             .ChartType = VtChChartType2dXY
  3444.  
  3445.             ' Put a picture in the backdrop
  3446.             For Each series In .Plot.SeriesCollection
  3447.                 series.SeriesMarker.Auto = False
  3448.                 series.SeriesMarker.show = True
  3449.                 series.DataPoints.Item(-1).Marker.Style = VtMarkerStyle3dBall
  3450.             Next
  3451.       
  3452.       End Select
  3453.    End With
  3454. End Sub
  3455.