Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Align y-axes on charts

I have a nuimber of sets of 3 charts, with each trio being linked but
differing quantities. The y-axis scales in each of the 3 charts are
automatic and hence do not align, which prevents easy cross-review.
Does anyone have any suggestions that will look at the first chart
maximum value on the y-axis and apply this maximum to the scale of the
other 2 charts? Thanks for any suggestions.;

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Align y-axes on charts



"MikeCM" wrote:

I have a nuimber of sets of 3 charts, with each trio being linked but
differing quantities. The y-axis scales in each of the 3 charts are
automatic and hence do not align, which prevents easy cross-review.
Does anyone have any suggestions that will look at the first chart
maximum value on the y-axis and apply this maximum to the scale of the
other 2 charts? Thanks for any suggestions.;



Hi Mike,

Try this. It will copy the entire format of chart 1 not just the max and
min on the axis. Just make sure to check your titles after this.

Sub ChartMatch()
Dim cobj As ChartObject
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy

For Each cobj In ActiveSheet.ChartObjects
cobj.Activate
ActiveChart.ChartArea.Select
ActiveChart.Paste Type:=xlFormats
Next
ActiveChart.Deselect
Set cobj = Nothing
End Sub

Regards,
Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Align y-axes on charts

Here's a way which doesn't require code, especially code that changes
everything. (Also, if the first chart scales its axes automatically, it will
not change the scale on the others, which will still scale automatically.)

Make a dummy data range which has the minimum and maximum values for all
three data ranges:

Xmin Ymin
Xmax Ymax

Add this range to each chart as another series, and format the new series to
be hidden (no markers, no lines). All three charts will use these values in
their autoscaling, so all will have the same axis scale parameters.

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


"MIKE215" wrote in message
...


"MikeCM" wrote:

I have a nuimber of sets of 3 charts, with each trio being linked but
differing quantities. The y-axis scales in each of the 3 charts are
automatic and hence do not align, which prevents easy cross-review.
Does anyone have any suggestions that will look at the first chart
maximum value on the y-axis and apply this maximum to the scale of the
other 2 charts? Thanks for any suggestions.;



Hi Mike,

Try this. It will copy the entire format of chart 1 not just the max and
min on the axis. Just make sure to check your titles after this.

Sub ChartMatch()
Dim cobj As ChartObject
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy

For Each cobj In ActiveSheet.ChartObjects
cobj.Activate
ActiveChart.ChartArea.Select
ActiveChart.Paste Type:=xlFormats
Next
ActiveChart.Deselect
Set cobj = Nothing
End Sub

Regards,
Mike





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Align y-axes on charts

thanks to both of you for this - these are useful pointers. Many thanks
for providing some direction!
Mike


Jon Peltier wrote:
Here's a way which doesn't require code, especially code that changes
everything. (Also, if the first chart scales its axes automatically, it will
not change the scale on the others, which will still scale automatically.)

Make a dummy data range which has the minimum and maximum values for all
three data ranges:

Xmin Ymin
Xmax Ymax

Add this range to each chart as another series, and format the new series to
be hidden (no markers, no lines). All three charts will use these values in
their autoscaling, so all will have the same axis scale parameters.

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


"MIKE215" wrote in message
...


"MikeCM" wrote:

I have a nuimber of sets of 3 charts, with each trio being linked but
differing quantities. The y-axis scales in each of the 3 charts are
automatic and hence do not align, which prevents easy cross-review.
Does anyone have any suggestions that will look at the first chart
maximum value on the y-axis and apply this maximum to the scale of the
other 2 charts? Thanks for any suggestions.;



Hi Mike,

Try this. It will copy the entire format of chart 1 not just the max and
min on the axis. Just make sure to check your titles after this.

Sub ChartMatch()
Dim cobj As ChartObject
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy

For Each cobj In ActiveSheet.ChartObjects
cobj.Activate
ActiveChart.ChartArea.Select
ActiveChart.Paste Type:=xlFormats
Next
ActiveChart.Deselect
Set cobj = Nothing
End Sub

Regards,
Mike




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
Is there an easy way to align charts? Rene Excel Discussion (Misc queries) 3 January 17th 09 10:13 PM
How to align charts on a page? Larryq22 Charts and Charting in Excel 1 November 12th 07 03:04 PM
Axes in Charts margie Charts and Charting in Excel 5 March 4th 07 12:32 PM
Align Line Charts By Milestone Dates? Mike Hartsough Charts and Charting in Excel 5 October 26th 06 09:14 PM
Charts - Align value & category data labels independently Stuart Bratesman Charts and Charting in Excel 1 February 2nd 06 06:20 PM


All times are GMT +1. The time now is 02:08 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"