Aligning two chart plot areas - simple but tricky!

A

Alseikhan

I have two dynamic lined charts whose chart areas are aligned; however
because the y-axis values change dramatically when graphing differen
ranges, the chart plot areas misalign (Y-axis shift to the right t
accomodate larger y-values displayed next to vertical axis). Thi
annoying behavior essentially puts the the two charted lines in the tw
charts out of alignment. Locking the chart areas by code does not help
since the plot area is the culprit!
Any help on how to align the actual plot areas by VBA code? (to b
clear, the aligned areas must not include the y-axis values which ca
alternate between 1-100 range to 1-1000,000 range)
Thank you in advanice for your valuable assistance.

Alseikha
 
J

Jon Peltier

You have to dig into the object model to get the plot inside area. I have
posted a workbook with some fairly simple code that does this:

http://peltiertech.com/Excel/Charts/AlignCharts.html

Whenever possible, I avoid this technique and use a combination chart
designed for the specific application.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services - Tutorials and Custom Solutions -
http://PeltierTech.com/
2006 Excel User Conference, 19-21 April, Atlantic City, NJ
http://peltiertech.com/Excel/ExcelUserConf06.html
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top