Consulting

Results 1 to 3 of 3

Thread: chart background divided into segments

  1. #1
    VBAX Regular
    Joined
    Sep 2004
    Posts
    61
    Location

    chart background divided into segments

    Hello forum,

    I am not sure if I need VBA for this.

    I have approx 40 line charts embedded into my workbook (1 for each workshheet)

    Each line displays 56 points of data. (8 weeks data .. a point for each day)

    I want to have a different colour backgraound for each two weeks data, therefore want the background divided into 4 colours.

    Does anyone know how to do this?

    cheers
    Koala

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I don't how, or whether, you can do what you want, but you could use a fill colour with a gradient.

    I would caution against overuse of colour though, it can often diffuse the message.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    MS Excel MVP VBAX Mentor Andy Pope's Avatar
    Joined
    May 2004
    Location
    Essex, England
    Posts
    344
    Location
    You can create the effect you a combination chart.

    Assuming your line chart as it's 56 data points in the range A1:B57 you need to add 4 more data series.
    In the range C1:F2 add the following data

    C1: =Week1-2
    D1: =Week3-4
    E1: =Week5-6
    F1: =Week7-8

    C2: =2
    D2: =2
    E2: =2
    F2: =2

    In xl2003 you can select and drop the range C1:F2 on to the chart to add the 4 new series.

    Select one of the series and change the chart type to Stacked Bar.
    Repeat for the other 3 series.
    Select one of the bars and display the format dialog. On the Series Options tab set the Gap Width to zero.
    Format each of the bars as required.
    Finally double click the secondary value axis and set the Maximum scale to 8.

    You should now have your 4 vertical bands.

    The same data can be used in the other 39 charts.
    And to save time you record the steps in a set of macros and apply them to each chart.
    Cheers
    Andy

Posting Permissions

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