'Draw Graphs
'--------------
'Create a new chart
Dim oChart As WCChart
QuickFlowGraph.Clear
QuickFlowGraph.Refresh
Set oChart = QuickFlowGraph.Charts.Add
'Add a title to the chart
oChart.HasTitle = True
oChart.Title.Caption = "X Y Test Graph"
Dim oSeries As WCSeries
'Line2
Set oSeries = oChart.SeriesCollection.Add
With oSeries
.Caption = "Line 2 "
.SetData chDimValues, chDataLiteral, x2
.SetData chDimValues, chDataLiteral, Line2
.Type = chChartTypeLineStacked
End With
'Line3
Set oSeries = oChart.SeriesCollection.Add
With oSeries
.Caption = "Line 3"
.SetData chDimValues, chDataLiteral, x2
.SetData chDimValues, chDataLiteral, Line3
.Type = chChartTypeLineStacked
End With
'Line4
Set oSeries = oChart.SeriesCollection.Add
With oSeries
.Caption = "Line 4 "
.SetData chDimValues, chDataLiteral, x4
.SetData chDimValues, chDataLiteral, Line4
.Type = chChartTypeLineStacked
End With
'Add a value axis to the right of the chart for the second series
oChart.Axes.Add oChart.Axes(chAxisPositionLeft).Scaling, _
chAxisPositionRight, chValueAxis
'Format the Value Axes
With oChart.Axes(chAxisPositionLeft)
.NumberFormat = "#,##0"
'.MajorUnit = 1000
End With
With oChart.Axes(chAxisPositionRight)
.NumberFormat = "#,##0"
'.MajorUnit = 1000
End With
'Show the legend at the bottom of the chart
oChart.HasLegend = True
oChart.Legend.Position = chLegendPositionBottom