J
JWS315
I am using automation in Access to create a Word document with an embedded
Graph Radar chart using the code below but I cannot figure out how to change
the color and width of the data line - Any help would be greatly appreciated!
RowAry = 0
ColAry = 0
Set oShape = docFinal.InlineShapes.AddOLEObject(ClassType:="MSGraph.Chart",
DisplayAsIcon:=False, Range:=myRange)
Set oChart = oShape.OLEFormat.Object
With oChart
..ChartArea.Font.Size = 8
..Application.Update
..ChartType = xlRadarMarkers
'Add data for the chart to the DataSheet in MSGraph.
With .Application.DataSheet
..Cells.Clear
'Data labels for Radar chart
For c = 2 To cntScore + 1
..Cells(1, c).Value = aryGraphdata(RowAry, 0)
RowAry = RowAry + 1
Next c
RowAry = 0
'Data for Radar chart
For c = 2 To cntScore + 1
..Cells(2, c).Value = aryGraphdata(RowAry, 1)
RowAry = RowAry + 1
Next c
End With
..Application.Update
'Format chart options
With oChart
..ChartArea.Font.Size = 8
..Application.Update
..HasLegend = False
..HasTitle = False
..PlotArea.Border.Color = RGB(255, 255, 255)
..PlotArea.Interior.Color = RGB(255, 255, 255)
..ChartArea.Font.Size = 8
..ChartArea.AutoScaleFont = False
End With
With oChart.Axes(xlValue)
..MinimumScale = 0
..MaximumScale = 100
..MajorUnit = 20
End With
..Application.Update 'Update the changes
..Application.Quit 'and deactivate the chart.
End With
'Clean up.
Set oChart = Nothing
Set oShape = Nothing
Thanks,
Jerry
Graph Radar chart using the code below but I cannot figure out how to change
the color and width of the data line - Any help would be greatly appreciated!
RowAry = 0
ColAry = 0
Set oShape = docFinal.InlineShapes.AddOLEObject(ClassType:="MSGraph.Chart",
DisplayAsIcon:=False, Range:=myRange)
Set oChart = oShape.OLEFormat.Object
With oChart
..ChartArea.Font.Size = 8
..Application.Update
..ChartType = xlRadarMarkers
'Add data for the chart to the DataSheet in MSGraph.
With .Application.DataSheet
..Cells.Clear
'Data labels for Radar chart
For c = 2 To cntScore + 1
..Cells(1, c).Value = aryGraphdata(RowAry, 0)
RowAry = RowAry + 1
Next c
RowAry = 0
'Data for Radar chart
For c = 2 To cntScore + 1
..Cells(2, c).Value = aryGraphdata(RowAry, 1)
RowAry = RowAry + 1
Next c
End With
..Application.Update
'Format chart options
With oChart
..ChartArea.Font.Size = 8
..Application.Update
..HasLegend = False
..HasTitle = False
..PlotArea.Border.Color = RGB(255, 255, 255)
..PlotArea.Interior.Color = RGB(255, 255, 255)
..ChartArea.Font.Size = 8
..ChartArea.AutoScaleFont = False
End With
With oChart.Axes(xlValue)
..MinimumScale = 0
..MaximumScale = 100
..MajorUnit = 20
End With
..Application.Update 'Update the changes
..Application.Quit 'and deactivate the chart.
End With
'Clean up.
Set oChart = Nothing
Set oShape = Nothing
Thanks,
Jerry