|
-
Aug 3rd, 2011, 09:30 PM
#1
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
-
Aug 4th, 2011, 12:03 AM
#2
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
-
Aug 4th, 2011, 09:47 AM
#3
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
-
Aug 4th, 2011, 11:05 AM
#4
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
-
Aug 4th, 2011, 11:28 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|