HOW TO
Instructions provided use the following VBA macro to list the RGB values for the colors used in a graph.
Code:
Sub OutputGraphColors()
Dim RGBColorArray(16) As String
' assign array values based on IDataGraphColorTable documentation
RGBColorArray(0) = "0,0,0" 'Black
RGBColorArray(1) = "0,0,128" 'Blue
RGBColorArray(2) = "0,128,0" 'Green
RGBColorArray(3) = "0,128,128" 'Cyan
RGBColorArray(4) = "128,0,0" 'Red
RGBColorArray(5) = "128,0,128" 'Magenta
RGBColorArray(6) = "128,128,0" 'Brown
RGBColorArray(7) = "192,192,192" 'Light Gray
RGBColorArray(8) = "128,128,128" 'Gray
RGBColorArray(9) = "0,0,255" 'Light Blue
RGBColorArray(10) = "0,255,0" 'Light Green
RGBColorArray(11) = "0,255,255" 'Light Cyan
RGBColorArray(12) = "255,0,0" 'Light Red
RGBColorArray(13) = "255,0,255" 'Light Magenta
RGBColorArray(14) = "255,255,0" 'Yellow
RGBColorArray(15) = "255,255,255" 'White
Dim pDataGraphs As IDataGraphs
Set pDataGraphs = ThisDocument
Dim pDataGraph As IDatagraph
Set pDataGraph = pDataGraphs.Item(0) 'first graph
Dim pDataGraphColorTable As IDataGraphColorTable
Set pDataGraphColorTable = pDataGraph
Dim i As Integer
For i = 0 To pDataGraphColorTable.size - 1
Debug.Print RGBColorArray(pDataGraphColorTable.ColorRGB(i))
Next i
End Sub
Article ID:000006544
Get help from ArcGIS experts
Download the Esri Support App