Results 1 to 2 of 2
  1. #1
    Lounger
    Join Date
    Feb 2004
    Location
    Hatboro, Pennsylvania, USA
    Posts
    28
    Thanks
    0
    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 ??

    ~~~Paul

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    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:
    vbBlack
    vRed
    vbGreen
    vbYellow
    vbBlue
    vbMagenta
    vbCyan
    vbWhite

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •