+ Reply to Thread
Results 1 to 2 of 2

Coloring of Excel Chart

  1. #1
    Darryn Lavery
    Guest

    Coloring of Excel Chart

    Re-posting from

    http://forums.microsoft.com/MSDN/Sho...26051&SiteID=1

    Thanks

    Darryn

    ------

    Hello,

    I'm generating Excel-Charts via VSTO in VB .NET. For the Seriescollections I
    want to set given RGB-Values like RGB(223, 0, 48) for red. But the colors are
    different from the colors, when I generate Chart objects in Excel-VBA.

    It seems that the RGB-Colors in VSTO / VB .NET not scalable like it shoud
    be. It seems furhter more that there are only a few colors avialable, wenn I
    increase or decrease the RGB-Colors they only get brighter or darker in
    intervalls.

    e.g.
    mySeries.Interior.Color = RGB(223, 0, 48) shows the same color as
    mySeries.Interior.Color = RGB(204, 0, 35)

    My Screen-Setting are settet to 32-bit true color. Do you have any ideas how
    to solve this phenomenon?





  2. #2
    Andy Pope
    Guest

    Re: Coloring of Excel Chart

    Hi,

    Excel is restricted, in some areas, to a 56 colour palette. Charts is
    one such area. When you specify the RGB colour Excel maps it to the
    nearest colour in it's palette.

    For details on colour in excel see here,
    http://www.mvps.org/dmcritchie/excel/colors.htm

    For a demonstration, not solution, of your problem in action see here,
    http://www.andypope.info/charts/spectrum.htm

    Cheers
    Andy

    Darryn Lavery wrote:
    > Re-posting from
    >
    > http://forums.microsoft.com/MSDN/Sho...26051&SiteID=1
    >
    > Thanks
    >
    > Darryn
    >
    > ------
    >
    > Hello,
    >
    > I'm generating Excel-Charts via VSTO in VB .NET. For the Seriescollections I
    > want to set given RGB-Values like RGB(223, 0, 48) for red. But the colors are
    > different from the colors, when I generate Chart objects in Excel-VBA.
    >
    > It seems that the RGB-Colors in VSTO / VB .NET not scalable like it shoud
    > be. It seems furhter more that there are only a few colors avialable, wenn I
    > increase or decrease the RGB-Colors they only get brighter or darker in
    > intervalls.
    >
    > e.g.
    > mySeries.Interior.Color = RGB(223, 0, 48) shows the same color as
    > mySeries.Interior.Color = RGB(204, 0, 35)
    >
    > My Screen-Setting are settet to 32-bit true color. Do you have any ideas how
    > to solve this phenomenon?
    >
    >
    >
    >


    --

    Andy Pope, Microsoft MVP - Excel
    http://www.andypope.info

+ 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