+ Reply to Thread
Results 1 to 10 of 10

Converting Column Object to Line Object Issue

Hybrid View

  1. #1
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Converting Column Object to Line Object Issue

    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?
    Cheers
    Andy
    www.andypope.info

  2. #2
    Registered User
    Join Date
    07-06-2009
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Converting Column Object to Line Object Issue

    Quote Originally Posted by Andy Pope View Post
    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.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Converting Column Object to Line Object Issue

    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.

  4. #4
    Registered User
    Join Date
    07-06-2009
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Converting Column Object to Line Object Issue

    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:

    chtActiveChart.SeriesCollection(i).Select
    With Selection
    If .ChartType <> xlLine Then
    .Format.Fill.ForeColor.RGB = garrColorPalette(i) .Border.ColorIndex = xlColorIndexNone
    Else
    .Format.Line.ForeColor.RGB = garrColorPalette(i)
    End If
    End With
    The "garrColorPalette" array object stores the RGB values specified by the client.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Converting Column Object to Line Object Issue

    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?

  6. #6
    Registered User
    Join Date
    07-06-2009
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Converting Column Object to Line Object Issue

    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.

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Converting Column Object to Line Object Issue

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1