Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Auto-scaling on Y axis inconsistent

I have found that when producing XY scatter charts, the scale on the Y-axisis
not always auto-scaled to a sensible range. For example, I had a chart where
all the data points were between 195 and 250 on the Y axis. Instead of
auto-scaling the axis to run from 190 to 255 (approx) as expected, the Y axis
runs all the way down to zero, leaving a relatively large blank area on the
chart. I have tried changing the 'Format Axis' options, and ensured that
'Auto' was checked in all cases. Exponential scales are inappropriate for
this application.

In another chart however, where the data range was slightly smaller, (all
points between 210 and 250), Excel elected to sensibly auto-scale the Y axis
so that it only ran from 205 to 255, and the plot fills the chart area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or suggest how i
might 'fix' the auto-scaling of axes.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1,071
Default Auto-scaling on Y axis inconsistent

There is a MSKB article that explains how XL sets the scaling of a chart
axis. From what I remember, it referred to XL5 or something like that but
if you are interested search msdn.microsoft.com and support.microsoft.com

As far as solving it goes, you would have to use code. Either write your
own routine that sets the axis max. and min. scales based on your own
algorithm (maybe the value in some cell?) or use a ready-made solution such
as
AutoChart Manager
http://www.tushar-mehta.com/excel/so...art/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rpsummers
says...
I have found that when producing XY scatter charts, the scale on the Y-axisis
not always auto-scaled to a sensible range. For example, I had a chart where
all the data points were between 195 and 250 on the Y axis. Instead of
auto-scaling the axis to run from 190 to 255 (approx) as expected, the Y axis
runs all the way down to zero, leaving a relatively large blank area on the
chart. I have tried changing the 'Format Axis' options, and ensured that
'Auto' was checked in all cases. Exponential scales are inappropriate for
this application.

In another chart however, where the data range was slightly smaller, (all
points between 210 and 250), Excel elected to sensibly auto-scale the Y axis
so that it only ran from 205 to 255, and the plot fills the chart area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or suggest how i
might 'fix' the auto-scaling of axes.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Auto-scaling on Y axis inconsistent

Thank-you for your response. I have read the MSKB article to which you refer
(214075), and it seems that XL is not behaving as randomly as I first
thought. The part that seems to be causing me problems is:

"If the difference between yMax and yMin is greater than 16.667 percent of
the value of yMax, the automatic minimum for the y-axis is zero."

I would like to have XL effectively ignore this 'if' statement in the
algorithm, so that the axis minimum is always set to the first Major division
less than or equal to yMin. I do not have much experience with XL coding -
would anyone be able to give me some pointers as to where I might begin
editing the algorithm, if this is even possible?

"Tushar Mehta" wrote:

There is a MSKB article that explains how XL sets the scaling of a chart
axis. From what I remember, it referred to XL5 or something like that but
if you are interested search msdn.microsoft.com and support.microsoft.com

As far as solving it goes, you would have to use code. Either write your
own routine that sets the axis max. and min. scales based on your own
algorithm (maybe the value in some cell?) or use a ready-made solution such
as
AutoChart Manager
http://www.tushar-mehta.com/excel/so...art/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rpsummers
says...
I have found that when producing XY scatter charts, the scale on the Y-axisis
not always auto-scaled to a sensible range. For example, I had a chart where
all the data points were between 195 and 250 on the Y axis. Instead of
auto-scaling the axis to run from 190 to 255 (approx) as expected, the Y axis
runs all the way down to zero, leaving a relatively large blank area on the
chart. I have tried changing the 'Format Axis' options, and ensured that
'Auto' was checked in all cases. Exponential scales are inappropriate for
this application.

In another chart however, where the data range was slightly smaller, (all
points between 210 and 250), Excel elected to sensibly auto-scale the Y axis
so that it only ran from 205 to 255, and the plot fills the chart area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or suggest how i
might 'fix' the auto-scaling of axes.

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1,071
Default Auto-scaling on Y axis inconsistent

One cannot override XL's built-in algorithm though it would be nice if one
could. {grin}

The only solution that I know of is to override it. Write your own VBA
code. While the core code is trivial, generalizing it for any arbitrary
chart, and figuring out the circumstances when it should execute is what
makes it non-trivial. And, the reason for the add-in.

The trivial example. In some sheet create a chart using data in, say column
A (A1:A4 in my test). Then, in B3, which will be the 'maximum value' cell,
enter =MAX(A1:A4)+1. In C4, which will be the 'minimum value' cell, enter
=MIN(A1:A4)-1. Adjust to your own data set.

Next, get to the sheet's code module: right click the sheet's tab, then
select 'View Code'). In there enter the below code. The code changes the
max. and min. values of the y-axis for a chart so that they always equal the
value in B3 and C4 respectively.

Option Explicit
Private Sub setLimits(aChart As Chart, MaxVal As Double, _
MinVal As Double)
With aChart
.Axes(xlValue).MaximumScale = MaxVal
.Axes(xlValue).MinimumScale = MinVal
End With
End Sub

Private Sub Worksheet_Calculate()
With ActiveSheet
setLimits .ChartObjects(1).Chart, _
.Range("b3").Value, .Range("c4").Value
End With
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
With Target.Parent
If Intersect(Target, .Range("B3,C4")) Is Nothing Then Exit Sub
setLimits .ChartObjects(1).Chart, _
.Range("b3").Value, .Range("c4").Value
End With
End Sub


--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rpsummers
says...
Thank-you for your response. I have read the MSKB article to which you refer
(214075), and it seems that XL is not behaving as randomly as I first
thought. The part that seems to be causing me problems is:

"If the difference between yMax and yMin is greater than 16.667 percent of
the value of yMax, the automatic minimum for the y-axis is zero."

I would like to have XL effectively ignore this 'if' statement in the
algorithm, so that the axis minimum is always set to the first Major division
less than or equal to yMin. I do not have much experience with XL coding -
would anyone be able to give me some pointers as to where I might begin
editing the algorithm, if this is even possible?

"Tushar Mehta" wrote:

There is a MSKB article that explains how XL sets the scaling of a chart
axis. From what I remember, it referred to XL5 or something like that but
if you are interested search msdn.microsoft.com and support.microsoft.com

As far as solving it goes, you would have to use code. Either write your
own routine that sets the axis max. and min. scales based on your own
algorithm (maybe the value in some cell?) or use a ready-made solution such
as
AutoChart Manager
http://www.tushar-mehta.com/excel/so...art/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rpsummers
says...
I have found that when producing XY scatter charts, the scale on the Y-axisis
not always auto-scaled to a sensible range. For example, I had a chart where
all the data points were between 195 and 250 on the Y axis. Instead of
auto-scaling the axis to run from 190 to 255 (approx) as expected, the Y axis
runs all the way down to zero, leaving a relatively large blank area on the
chart. I have tried changing the 'Format Axis' options, and ensured that
'Auto' was checked in all cases. Exponential scales are inappropriate for
this application.

In another chart however, where the data range was slightly smaller, (all
points between 210 and 250), Excel elected to sensibly auto-scale the Y axis
so that it only ran from 205 to 255, and the plot fills the chart area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or suggest how i
might 'fix' the auto-scaling of axes.

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Auto-scaling on Y axis inconsistent

http://support.microsoft.com/kb/214075

Found it!

"bebeto" wrote:

Thank-you for your response. I have read the MSKB article to which you refer
(214075), and it seems that XL is not behaving as randomly as I first
thought. The part that seems to be causing me problems is:

"If the difference between yMax and yMin is greater than 16.667 percent of
the value of yMax, the automatic minimum for the y-axis is zero."

I would like to have XL effectively ignore this 'if' statement in the
algorithm, so that the axis minimum is always set to the first Major division
less than or equal to yMin. I do not have much experience with XL coding -
would anyone be able to give me some pointers as to where I might begin
editing the algorithm, if this is even possible?

"Tushar Mehta" wrote:

There is a MSKB article that explains how XL sets the scaling of a chart
axis. From what I remember, it referred to XL5 or something like that but
if you are interested search msdn.microsoft.com and support.microsoft.com

As far as solving it goes, you would have to use code. Either write your
own routine that sets the axis max. and min. scales based on your own
algorithm (maybe the value in some cell?) or use a ready-made solution such
as
AutoChart Manager
http://www.tushar-mehta.com/excel/so...art/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rpsummers
says...
I have found that when producing XY scatter charts, the scale on the Y-axisis
not always auto-scaled to a sensible range. For example, I had a chart where
all the data points were between 195 and 250 on the Y axis. Instead of
auto-scaling the axis to run from 190 to 255 (approx) as expected, the Y axis
runs all the way down to zero, leaving a relatively large blank area on the
chart. I have tried changing the 'Format Axis' options, and ensured that
'Auto' was checked in all cases. Exponential scales are inappropriate for
this application.

In another chart however, where the data range was slightly smaller, (all
points between 210 and 250), Excel elected to sensibly auto-scale the Y axis
so that it only ran from 205 to 255, and the plot fills the chart area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or suggest how i
might 'fix' the auto-scaling of axes.

Thanks




  #6   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default Auto-scaling on Y axis inconsistent

The article doesn't describe how the major unit is calculated,
unfortunately. And there's no way to turn off the IF part of the minimum
determination, without turning off the automatic scaling.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Lasci" wrote in message
...
http://support.microsoft.com/kb/214075

Found it!

"bebeto" wrote:

Thank-you for your response. I have read the MSKB article to which you
refer
(214075), and it seems that XL is not behaving as randomly as I first
thought. The part that seems to be causing me problems is:

"If the difference between yMax and yMin is greater than 16.667 percent
of
the value of yMax, the automatic minimum for the y-axis is zero."

I would like to have XL effectively ignore this 'if' statement in the
algorithm, so that the axis minimum is always set to the first Major
division
less than or equal to yMin. I do not have much experience with XL
coding -
would anyone be able to give me some pointers as to where I might begin
editing the algorithm, if this is even possible?

"Tushar Mehta" wrote:

There is a MSKB article that explains how XL sets the scaling of a
chart
axis. From what I remember, it referred to XL5 or something like that
but
if you are interested search msdn.microsoft.com and
support.microsoft.com

As far as solving it goes, you would have to use code. Either write
your
own routine that sets the axis max. and min. scales based on your own
algorithm (maybe the value in some cell?) or use a ready-made solution
such
as
AutoChart Manager
http://www.tushar-mehta.com/excel/so...art/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
rpsummers
says...
I have found that when producing XY scatter charts, the scale on the
Y-axisis
not always auto-scaled to a sensible range. For example, I had a
chart where
all the data points were between 195 and 250 on the Y axis. Instead
of
auto-scaling the axis to run from 190 to 255 (approx) as expected,
the Y axis
runs all the way down to zero, leaving a relatively large blank area
on the
chart. I have tried changing the 'Format Axis' options, and ensured
that
'Auto' was checked in all cases. Exponential scales are
inappropriate for
this application.

In another chart however, where the data range was slightly smaller,
(all
points between 210 and 250), Excel elected to sensibly auto-scale the
Y axis
so that it only ran from 205 to 255, and the plot fills the chart
area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or
suggest how i
might 'fix' the auto-scaling of axes.

Thanks




  #7   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 3
Default Auto-scaling on Y axis inconsistent

Hi,

I too am looking into the same thing and can`t seem to find the article,
does anyone have a helpful link to it?

Thanks!

"bebeto" wrote:

Thank-you for your response. I have read the MSKB article to which you refer
(214075), and it seems that XL is not behaving as randomly as I first
thought. The part that seems to be causing me problems is:

"If the difference between yMax and yMin is greater than 16.667 percent of
the value of yMax, the automatic minimum for the y-axis is zero."

I would like to have XL effectively ignore this 'if' statement in the
algorithm, so that the axis minimum is always set to the first Major division
less than or equal to yMin. I do not have much experience with XL coding -
would anyone be able to give me some pointers as to where I might begin
editing the algorithm, if this is even possible?

"Tushar Mehta" wrote:

There is a MSKB article that explains how XL sets the scaling of a chart
axis. From what I remember, it referred to XL5 or something like that but
if you are interested search msdn.microsoft.com and support.microsoft.com

As far as solving it goes, you would have to use code. Either write your
own routine that sets the axis max. and min. scales based on your own
algorithm (maybe the value in some cell?) or use a ready-made solution such
as
AutoChart Manager
http://www.tushar-mehta.com/excel/so...art/index.html

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , rpsummers
says...
I have found that when producing XY scatter charts, the scale on the Y-axisis
not always auto-scaled to a sensible range. For example, I had a chart where
all the data points were between 195 and 250 on the Y axis. Instead of
auto-scaling the axis to run from 190 to 255 (approx) as expected, the Y axis
runs all the way down to zero, leaving a relatively large blank area on the
chart. I have tried changing the 'Format Axis' options, and ensured that
'Auto' was checked in all cases. Exponential scales are inappropriate for
this application.

In another chart however, where the data range was slightly smaller, (all
points between 210 and 250), Excel elected to sensibly auto-scale the Y axis
so that it only ran from 205 to 255, and the plot fills the chart area and is
easier to read. I would like this to happen with all my charts.

Can anyone explain what might be causing this inconsistency or suggest how i
might 'fix' the auto-scaling of axes.

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent - X and Y Axis Auto Scale for Chart Sandi Charts and Charting in Excel 3 June 9th 06 09:04 AM
Can you link primary and secondary axis zero, scaling? CarolM Charts and Charting in Excel 3 April 24th 06 01:30 AM
Axis scaling resets every time I open the file Yaron Assa Excel Discussion (Misc queries) 0 April 4th 06 07:27 AM
Y Axis Auto Scale Arturo Charts and Charting in Excel 1 March 27th 06 04:23 PM
Chart Axis Scale Auto Values Moses Bunting Charts and Charting in Excel 1 June 7th 05 11:03 PM


All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"