Results 1 to 5 of 5

Thread: Excel - Chart x-axis "matching"/"pacing"

  1. #1

    Thread Starter
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Excel - Chart x-axis "matching"/"pacing"

    I have a series of 200 days' worth of running totals.
    The tricky bit is that "calendar-wise", it covers 1,900 days.

    Is there a way to "spread out" the x-axis to "match" the
    1,900 days even there are only 200 rows in the series?

    For example, using just this data ...
    Code:
    Row  Day    Total
    1    1      45
    2    5      72
    3    12     87
    4    15     89
    5    18     125
    ...   
    200  1900   3795
    ... is there a way to somehow specify
    the x-axis such that the chart "paces"
    the Total, at intervals based on Day
    to mimic a full 1,900 rows such as ...
    Code:
    Day    Total
    1      45
    2      45
    3      45
    4      45
    5      72
    6      72
    7      72
    8      72
    9      72
    10     72
    11     72
    12     87
    ...   
    1900   3795
    ... where red indicates data not in
    the actual data series.

    Natch, a brute force approach would be to add the
    missing 1,700 rows (either manually or by a macro),
    but I'm wondering if there is a "quick and dirty" way
    to specify the x-axis (with just the 200 rows of data).

    Spoo

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Excel - Chart x-axis "matching"/"pacing"

    spoo, i just tried this, not sure this is what u need.
    Code:
    Dim Cnt As Integer, Expand As Integer, Repeat As Integer, Balance As Integer
    Dim x As Integer, SeqNo As Integer
    Cnt = Range("b" & Rows.Count).End(xlUp).Row 'Total column
    Expand = 1900
    Repeat = Int(Expand / Cnt)
    x = 1
    SeqNo = 1
    For i = 1 To Expand
        If Not i Mod Repeat = 0 Then
            Range("c" & i) = SeqNo
            Range("d" & i) = Range("b" & x)
        Else
            Range("c" & i) = SeqNo
            Range("d" & i) = Range("b" & x)
            If x < Cnt Then x = x + 1
        End If
        SeqNo = SeqNo + 1
    Next
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3

    Thread Starter
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Excel - Chart x-axis "matching"/"pacing"

    Seenu

    Thanks, but not quite what I had in mind.

    That is the "brute force" macro alternative that I
    was trying to avoid. It may, however, be the only
    solution - a macro along the lines that you proposed.

    Spoo

  4. #4
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: Excel - Chart x-axis "matching"/"pacing"

    Spoo,
    do u mean to use any function of excel rather than macro? if yes any kind?, sorry i cant get whats in ur mind
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  5. #5

    Thread Starter
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Excel - Chart x-axis "matching"/"pacing"

    Seenu

    Sorry, I thought it was obvious ..

    Something like:
    • right click on chart
    • select Source Data
    • select Series tab
    • Category (X) axis labels ........... << somehow, do something here


    Spoo

Posting Permissions

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



Click Here to Expand Forum to Full Width