View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Vic Eldridge[_3_] Vic Eldridge[_3_] is offline
external usenet poster
 
Posts: 112
Default How to catch the colorindex in a series

With ActiveChart.SeriesCollection(1)
.Trendlines(1).Border.ColorIndex = .Fill.ForeColor.SchemeColor
End With

It's a pity they didn't stick to a single convention.


Regards,
Vic Eldridge


"leglouton" wrote:


Thanks for your feedback but I need of the actual colour. I want to add
to my series a trendline with the same color. If I apply the same
colorindex with xlautomatic, the colour is different. The property
colorindex from an object trendline set to xlautomatic give always the
same color (black in my case) for each series.

leglouton

Peter T a écrit:
If all you want to do is colour your point to the same colour as its marker,
apply the same colorindex as returned from the marker, even if xlautomatic.

You may want to ensure your point has a marker to avoid applying xlNone,
effectively invisible, eg

x = .MarkerBackgroundColorIndex
if x = xlNone then x = xlAutomatic
myPoint.border.colorindex = x.

If you have only one series and vary colors by point, you would need to do
each point individually.

Come back if you need the actual automatic colour for some other reason not
mentioned in your post.

Regards,
Peter T

"leglouton" wrote in message
...

How to catch the line or the point's color in an object serie from a
chart when property is set to xlColorIndexAutomatic.

For example if My_series is a series object with his property
MarkerBackgroundColorIndex set to xlColorIndexAutomatic. How to catch
the color give by Excel to fill the points of my series