PDA

View Full Version : [SOLVED] Custom scale in chart



slashiiboy
06-09-2017, 09:41 PM
Hi everybody, I am trying to customize my "x" axis in a chart, this axis contains years and "y" axis contains the number of events. So what I am trying to do is to start my "x" axis in the year 1904, then the next year should be 1910, 1920, 1930.....2013. I must use this specific interval, it must start in 1904, the next value 1910 adding 10 years at a time till 2013 exactly. I've been trying with this VBA code:


Sub ScaleAxes()
With Application.ActiveChart.Axes(xlCategory, xlPrimary)
.MinimumScale = ActiveSheet.Range("t3").Value
.MaximumScale = ActiveSheet.Range("t15").Value
.MajorUnit = ActiveSheet.Range("t17").Value
.DisplayUnit = ActiveSheet.Range("t15").Value
End With


End Sub


But this only helps me to set the minimun and maximum I am still trying to figure how to start the sum in 1910.... The final scale should look like this:

1904,1910, 1920.....2013

THANKS IN ADVANCE

p45cal
06-10-2017, 04:28 AM
Supply a file with your chart and its data for us to experiment with - it'll answer quite a lot questions about how you've set it up.

ps. Finding this difficult in Excel 2010 with an xy scatter chart so far… What's your version of Excel and are those years actual Excel dates in the sheet?

mdmackillop
06-10-2017, 04:58 AM
Must the X axis spacing be proportionate? Have a look at this (http://peltiertech.com/line-charhttp://peltiertech.com/line-chart-for-unequal-intervals/t-for-unequal-intervals/)

p45cal
06-10-2017, 09:41 AM
You can do something like this but it's not especially easy:
19456

Aussiebear
06-10-2017, 08:15 PM
@Slashilboy.... posted this issue anywhere else recently?

slashiiboy
06-12-2017, 11:19 AM
19476
Here is an image of my graph, I hope this will help us to solve the initial problem

p45cal
06-12-2017, 01:34 PM
Here is an image of my graph, I hope this will help us to solve the initial problemNot at all.

Supply a file (not a picture of a file) with your chart and its data for us to experiment with - it'll answer quite a lot questions about how you've set it up.
Answer the questions that people who are trying to help you ask.
In msg#5, Aussiebear asked you about posting elsewhere (you have); please have a read of http://www.excelguru.ca/content.php?184, then post links to those posts.

Aussiebear
06-15-2017, 07:23 PM
@slashilboy Since you appear to be ignoring my question, I shall put your thread on hold until you pm me with your responce.