Results 1 to 8 of 8

Colors in a sunburst graph

Threaded View

Eastw00d Colors in a sunburst graph 03-26-2021, 07:26 AM
Bo_Ry Re: Colors in a sunburst graph 03-26-2021, 10:00 AM
Eastw00d Re: Colors in a sunburst graph 03-26-2021, 10:48 AM
Eastw00d Re: Colors in a sunburst graph 03-26-2021, 03:31 PM
Andy Pope Re: Colors in a sunburst graph 03-27-2021, 06:13 AM
Eastw00d Re: Colors in a sunburst graph 03-27-2021, 07:06 AM
Andy Pope Re: Colors in a sunburst graph 03-29-2021, 02:40 AM
Eastw00d Re: Colors in a sunburst graph 03-29-2021, 04:04 AM
  1. #1
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Colors in a sunburst graph

    Hi all,
    Below I have a "standard" sunburst chart, where I want to do 2 things, 1 to create a ring or segment of the same color and/or 2, to create a color of an individual item, based on the cell content. I have got so far information that I know that the graph is handling points, but in this particular case the number of individual points does not go beyond 16 where Points.Count = 24. That puzzles me.
    In this case I want to have "Okt" in green and "-0,8" in red
    I probably am making a thinking error, but I failed to see where.
    Sub ModifyTreeMap()
        Dim t, pnts, sr
        ActiveSheet.Shapes.Range("Chart 2").Select
    
        sr = ActiveChart.FullSeriesCollection.Count
        pnts = ActiveChart.FullSeriesCollection(sr).Points.Count
        
        For t = 1 To pnts
            With ActiveChart.FullSeriesCollection(sr).Points(t)
    '        Debug.Print ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text
            
            If Left(ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text, 2) = "wk" Then .Format.Fill.ForeColor.RGB = vbGreen
            If ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text = "Okt" Then .Format.Fill.ForeColor.RGB = vbGreen
            If ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text = "-0,8" Then .Format.Fill.ForeColor.RGB = vbRed
            End With
        Next t
        [g2].Select
    End Sub
    Please can you help me out?
    Cheers
    Erwin
    Attached Files Attached Files
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Graph Colors to match cell colors
    By hadoan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2019, 02:11 AM
  2. Graph colors
    By csnyder10 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-20-2018, 05:07 PM
  3. Bar graph with just two colors
    By klturi421 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-22-2014, 12:42 AM
  4. Graph bar colors
    By dferguson in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-12-2014, 08:37 PM
  5. Fix the colors of a graph
    By Sabini in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-23-2013, 03:16 AM
  6. Bar graph won't change colors
    By maxthebear in forum Excel General
    Replies: 2
    Last Post: 09-28-2009, 12:59 PM
  7. bar graph colors?
    By anantathaker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-17-2005, 11:48 AM

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