Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Repeating colors in excel 2007 area charts

I'm in the process of converting dynamically generated excel charts from
Excel 2003 to 2007. A couple problems I have resolved, but so far have not
been able to find a solution to a color repetition problem. The charts can
have anywhere from 2-3 legend entries to 15 -20. Problem is after the 1st
(lowest) three appear as individual colors, all the colors after that are the
same color. When this same chart is generated in 2003 no problems, 2007
repeating colors. So far I've tired to find some sort of legendkeys command
to set the colors to xlautomatic (which also works fine in 2003) but I can't
seem to find an example or the proper syntax to do this in 2007.

thanks,
jonathan

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Repeating colors in excel 2007 area charts

Hi,

I can not reproduce the problem with colours repeating.
But this code sets the colours to automatic.

Sub x()
Dim objSeries As Series

For Each objSeries In ActiveSheet.ChartObjects(1).Chart.SeriesCollection
objSeries.Interior.ColorIndex = xlAutomatic
Next
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"jon18" wrote in message
...
I'm in the process of converting dynamically generated excel charts from
Excel 2003 to 2007. A couple problems I have resolved, but so far have
not
been able to find a solution to a color repetition problem. The charts can
have anywhere from 2-3 legend entries to 15 -20. Problem is after the 1st
(lowest) three appear as individual colors, all the colors after that are
the
same color. When this same chart is generated in 2003 no problems, 2007
repeating colors. So far I've tired to find some sort of legendkeys
command
to set the colors to xlautomatic (which also works fine in 2003) but I
can't
seem to find an example or the proper syntax to do this in 2007.

thanks,
jonathan


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Repeating colors in excel 2007 area charts

perfect! I had to put in some logic (application.version) so that it only
attempts this in 2007 as it generates errors in 2003, but it fixes it right
up.
the scale is set in code on auto open, so I wonder if that is why I'm seeing
the change.

With Worksheets(1).ChartObjects(2).Chart
.Axes(xlValue).MajorUnit = 20
.Axes(xlValue).MinimumScaleIsAuto = True
.Axes(xlValue).MaximumScaleIsAuto = True
.Axes(xlValue).MinimumScale = intMinScale
.Axes(xlValue).MaximumScale = intMaxScale
End With


Anyway, this definitely takes care of the problem as my users convert to
2007.

thanks again!!
jonathan


"Andy Pope" wrote:

Hi,

I can not reproduce the problem with colours repeating.
But this code sets the colours to automatic.

Sub x()
Dim objSeries As Series

For Each objSeries In ActiveSheet.ChartObjects(1).Chart.SeriesCollection
objSeries.Interior.ColorIndex = xlAutomatic
Next
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"jon18" wrote in message
...
I'm in the process of converting dynamically generated excel charts from
Excel 2003 to 2007. A couple problems I have resolved, but so far have
not
been able to find a solution to a color repetition problem. The charts can
have anywhere from 2-3 legend entries to 15 -20. Problem is after the 1st
(lowest) three appear as individual colors, all the colors after that are
the
same color. When this same chart is generated in 2003 no problems, 2007
repeating colors. So far I've tired to find some sort of legendkeys
command
to set the colors to xlautomatic (which also works fine in 2003) but I
can't
seem to find an example or the proper syntax to do this in 2007.

thanks,
jonathan



  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Repeating colors in excel 2007 area charts

Hi,

Glad it worked although I'm confused about why you got errors in xl2003 as I
used that version to record the base code.

Changing the axis properties would not effect a Area chart but it would a
Surface chart as the scale bands determine the colours.

Cheers
Andy


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"jon18" wrote in message
...
perfect! I had to put in some logic (application.version) so that it
only
attempts this in 2007 as it generates errors in 2003, but it fixes it
right
up.
the scale is set in code on auto open, so I wonder if that is why I'm
seeing
the change.

With Worksheets(1).ChartObjects(2).Chart
.Axes(xlValue).MajorUnit = 20
.Axes(xlValue).MinimumScaleIsAuto = True
.Axes(xlValue).MaximumScaleIsAuto = True
.Axes(xlValue).MinimumScale = intMinScale
.Axes(xlValue).MaximumScale = intMaxScale
End With


Anyway, this definitely takes care of the problem as my users convert to
2007.

thanks again!!
jonathan


"Andy Pope" wrote:

Hi,

I can not reproduce the problem with colours repeating.
But this code sets the colours to automatic.

Sub x()
Dim objSeries As Series

For Each objSeries In
ActiveSheet.ChartObjects(1).Chart.SeriesCollection
objSeries.Interior.ColorIndex = xlAutomatic
Next
End Sub

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"jon18" wrote in message
...
I'm in the process of converting dynamically generated excel charts
from
Excel 2003 to 2007. A couple problems I have resolved, but so far have
not
been able to find a solution to a color repetition problem. The charts
can
have anywhere from 2-3 legend entries to 15 -20. Problem is after the
1st
(lowest) three appear as individual colors, all the colors after that
are
the
same color. When this same chart is generated in 2003 no problems,
2007
repeating colors. So far I've tired to find some sort of legendkeys
command
to set the colors to xlautomatic (which also works fine in 2003) but I
can't
seem to find an example or the proper syntax to do this in 2007.

thanks,
jonathan




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 colors do not match excel 2003 colors. Tom's Travails' Excel Discussion (Misc queries) 0 July 17th 08 01:56 AM
Multiple Colors on Area Charts SarahR. Charts and Charting in Excel 3 January 30th 08 03:04 PM
Pie Charts not Printing colors correctly - Office 2007 Gary Charts and Charting in Excel 0 October 4th 07 08:40 PM
Repeating colors in Excel 2000 DennyB Excel Worksheet Functions 0 January 17th 07 03:00 PM
How do I used two different colors in an excel graph plot area? lawmonkey Excel Discussion (Misc queries) 1 April 11th 06 05:43 PM


All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"