How are you changing chart type?
The line should retain the column series Border colour as it's line colour.
Do you have Office SP2 installed?
How are you changing chart type?
The line should retain the column series Border colour as it's line colour.
Do you have Office SP2 installed?
I'm simply setting the series collection's chart type property from xlColumnClustered to xlLine. My tool's requirements specify that column objects should have no border, but I am reapplying the appropriate colour afterwards in a separate subroutine. I am running Excel 2007 SP2.
But if your column has no border what colour should it use when switching to line. I assume excel just takes a stab at a colour perhaps using the automatic default colours.
I have a subroutine called "SeriesColorAllocation" which assigns a client-specified list of colors to my data series objects (i.e., line, column, area) based on their position on the worksheet. The subroutine is called after the data series' chart object has been changed. The main color assignment logic is as follows:
The "garrColorPalette" array object stores the RGB values specified by the client.![]()
chtActiveChart.SeriesCollection(i).Select With Selection
If .ChartType <> xlLine ThenEnd With.Format.Fill.ForeColor.RGB = garrColorPalette(i) .Border.ColorIndex = xlColorIndexNoneElse.Format.Line.ForeColor.RGB = garrColorPalette(i)End If
Sorry I'm confused now.
If you are coding all this can you not add code to set the colors you need?
Or is the problem that the setting of colours is not working?
My apologies for the confusion. Yes, the setting of the colors does not work for the specific instance whereby the user wants to switch from the current column object to the desired line object.
Try this
![]()
chtActiveChart.SeriesCollection(i).Select With Selection If .ChartType <> xlLine Then .Format.Fill.ForeColor.RGB = garrColorPalette(i) .Border.ColorIndex = xlColorIndexNone Else .Format.Line.transparency = 0 .Format.Line.ForeColor.RGB = garrColorPalette(i) End If End With
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks