MS Graph colors

D

Dave Dawson

Is it possible to programmatically change the color of an individual slice
of a pie chart to a specific RGB() color? If so, how? Should it be
possible in VFP?

Dave
 
S

Steve Rindsberg

Is it possible to programmatically change the color of an individual slice
of a pie chart to a specific RGB() color? If so, how? Should it be
possible in VFP?

No.

The object model allows you to specify any RGB color you like. The application
itself ignores you when you do it that way.

Well, not completely; it seems to pick from its own internal palette the
closest thing it can find to what you asked for.
 
D

Dave Dawson

I should have made it more clear. I was asking about doing this with
msgraph. I put msgraph in the subject but neglected to do so in the
message.

I'm assuming you were talking about excel charting itself.

Now, I should be able to change the workbook colors one at a time, shouldn't
I? If I need 8 specific colors, shouldn't I be able to change the first 8
colors in the pallette then change pie slices and columns using
colorindex()?

Even if this works, I'm afraid I'll still have to use the full
excel.application instead of msgraph.chart. Is that true?

When I try to change individual colors (either in the pallette or pie
slices) with msgraph.chart, I appear to get a blank stare.

Thanks,
Dave
 
S

Steve Rindsberg

I should have made it more clear. I was asking about doing this with
msgraph. I put msgraph in the subject but neglected to do so in the
message.

I'm assuming you were talking about excel charting itself.

No, I was talking specifically about MSGraph. I doublechecked the subject line
to make sure that's what you meant. ;-)
Now, I should be able to change the workbook colors one at a time, shouldn't
I?

Workbook? Hold on. You said MSGraph. No workbooks there.
If I need 8 specific colors, shouldn't I be able to change the first 8
colors in the pallette then change pie slices and columns using
colorindex()?

No. Or rather, you can change Tools, Options, Color tab and modify individual
colors in the chart's palette but as far as I'm aware, this trick isn't exposed
via the object model.
Even if this works, I'm afraid I'll still have to use the full
excel.application instead of msgraph.chart. Is that true?

When I try to change individual colors (either in the pallette or pie
slices) with msgraph.chart, I appear to get a blank stare.

Yep. You can change the colors of slices but only to "MSGraph-approved"
colors.
 
M

Michael Reese

I want to change the color index of a MS Graph object, which I expose i
an Access application. I can either do it programmatically (preferred
or at design time.

I can change the ColorIndex property of an Excel char
programmatically, using the workbook Colors(Index) property, with Inde
indicating the ColorIndex value to change. The Index range, of course
is 1 to 56, and to change the Index in Excel object wkbBook1, a
follows:

wkbBook1.Colors(44) = vbYellow

...changes the ColorIndex 44 to Yellow. Any color value can be used.


However, I cannot do the same code for the MS Graph object. I suspec
I'm looking at a higher level object to access. I would like to kno
which object controls the ColorIndex property for the MS Graph object
and if it can't be done programmatically, how can I set it at desig
time? I don't mind API or even registry changes, but I can't seem t
find the ColorIndex anywhere.

Thanks for your help
 
S

Steve Rindsberg

Michael Reese said:
I want to change the color index of a MS Graph object, which I expose in
an Access application. I can either do it programmatically (preferred)
or at design time.

You can change the Index, which points to one of the 56 MSGraph colors, but you
can't change the value of the color it points to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top