+ Reply to Thread
Results 1 to 3 of 3

Changing Pie chart slices' format dependant on the label

  1. #1
    Registered User
    Join Date
    08-11-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Changing Pie chart slices' format dependant on the label

    Hi,

    I've hit a brick wall and can't seem to work out what I'm doing wrong..

    I have a need to create some pie charts. Over the course of the year, the data series will have 12 items which needed to be charted. The same report is also produced on a monthly basis, and not all 12 items will be present every month.

    My manager wants the formatting of each slice to be the same from month to month, that is, every time the 'Apple' data point is displayed, it is coloured with the same colour and/or fill pattern.

    I understand that the XValues array within the series collection for the chart will contain the label of the data point (in this example "Apple") so what I think I want to do is to use a 'select case' based on the XValue for each element in the series collection and then adjust the point color etc based on the XValue returned.

    Currently, the following code fragment fails at the SeriesCollection(1).XValues(i) line with a "Wrong number of arguments or invalid property assignment" error.

    HighNum & LowNum are correctly set and I've managed to get the data label out of XValues once, during initial testing to see if this is a viable option, but unfortunately deleted the working code fragment in my enthusiasm to develop the complete routine and I can't remember how I got it to work

    I don't know what I'm doing wrong and can't see the wood from the trees. Can anyone point me in the right direction?

    Please Login or Register  to view this content.
    Thanks for your help
    Trevor

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

    Re: Changing Pie chart slices' format dependant on the label

    Store the Xvalue items in an array and then access that.
    You can not directly access an specific item in the Values or XValues array

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    08-11-2012
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Changing Pie chart slices' format dependant on the label

    Thanks Andy,

    Of course I couldn't think of that myself - that what happens when you stare at a computer screen for too long!

    Trev

+ 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