+ Reply to Thread
Results 1 to 4 of 4

Chart Line Colors

Hybrid View

  1. #1
    Registered User
    Join Date
    07-23-2007
    Posts
    1

    Chart Line Colors

    I'm writing some code in Access 97 that produces charts in Excel 2002. I can get the marker colors OK
    objExcel.ActiveChart.SeriesCollection(1).MarkerForegroundColor = RGB(r, g, b)
    but I can't get the line colors.

    My chart type is LineMarkers
    objExcel.ActiveChart.ChartType = xlLineMarkers
    Anyone know how to set the line colors?

  2. #2
    Registered User
    Join Date
    07-23-2007
    Posts
    10

    macro recorder potential answer

    I ran the macro recorder to try and answer your Q. The ColorIndex property seems the probable suspect

        ActiveChart.SeriesCollection(1).Select
        With Selection.Border
            .ColorIndex = 51
            .Weight = xlThin
            .LineStyle = xlContinuous
        End With
        With Selection
            .MarkerBackgroundColorIndex = xlNone
            .MarkerForegroundColorIndex = xlNone
            .MarkerStyle = xlNone
            .Smooth = False
            .MarkerSize = 17
            .Shadow = False
        End With

  3. #3
    Registered User
    Join Date
    07-02-2007
    Posts
    3
    I tried the same thing. Really sorry I didn't mentioned it. The problem with the ColorIndex property is that I don't know how to get RGB converted to ColorIndex. So maybe I should go the other way and use the macro recording feature to get the ColorIndex value just right. I was hoping to set both the markers and the lines using the same value system.

    Thanks

  4. #4
    Registered User
    Join Date
    07-02-2007
    Posts
    3
    Here's what I did:
                          .SeriesCollection(1).MarkerForegroundColorIndex = intColorIndex
                          .SeriesCollection(1).MarkerBackgroundColorIndex = intColorIndex
                          .SeriesCollection(1).Border.ColorIndex = intColorIndex
    Thanks for the suggestion.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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