Results 1 to 2 of 2
2004-05-07, 23:53 #1
- Join Date
- Feb 2004
- Hatboro, Pennsylvania, USA
- Thanked 0 Times in 0 Posts
Chart ColorIndex vs Shape SchemeColor (97, 2000)
I'm generating XY-scattercharts via VBA, each chart showing several curves.
A legend is required on each chart, but since the requirement is to show a rather extensive amount of related data in tabular form (also on the chartsheet), I've composed my own "legend" in the form of a sizeable textbox (and using Courier New, a monospace font, to keep things lined up vertically).
By each line of the textbox, I overlaid a little rectangle drawing-shape to be of the color of the corresponding curve on the chart.
In doing so, I found that for any given color, the Shapes(x).ForeColor.SchemeColor value is NOT the same as the chart.SeriesCollection.Border.ColorIndex value.
Since no chart in this application will ever have more than eight curves, by brute force, I figured out the corresponding color-indexes for these two types that would give me the same color (for instance, BLUE: ColorIndex = 5, SchemeColor=4) and made the table work.
BUT, why the differing index values for the colors, and (of more concern), is it possible that one or both index types will yield some other colors (bad !) on another system ??
2004-05-08, 02:49 #2
- Join Date
- Jul 2002
- Pittsburgh, Pennsylvania, USA
- Thanked 342 Times in 335 Posts
Re: Chart ColorIndex vs Shape SchemeColor (97, 2000)
I would think that the best way to make sure they are "in sync" is to set the color (not the colorindex) using RGB colors and to use the RGB property and not the schemecolor. Using RGB values for both will set the colors to what you define them and the scheme and the colorindex (which can be changed) will no matter.
The 8 "basic colors" already have constant names you can use instead of using the RGB function: