Forum

Small Multiples - p...
 
Notifications
Clear all

Small Multiples - plot area width and height

7 Posts
2 Users
0 Reactions
100 Views
(@matthias)
Posts: 49
Trusted Member
Topic starter
 

Hi, the Small Multiples give a good example where you want to align the plot area size between different charts:

When you remove the vertical or horizontal axis the size of the plot area changes. So in your nice example the width of Regions A&E is more narrow than the other regions and and the top row Regions A-D are higher than the lower row.

What would be the easiest way to align the plot area's width and height?

Thanks,
Matthias

 
Posted : 12/11/2018 5:16 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Matthias,

I would create two charts, one with the axis labels and one without. Then align the plot area manually by placing the chart without labels on top of the chart with (set the fill of the chart without labels to No Fill). Once you have the plot area sizes the same simply duplicate the chart without the labels and then edit the Source Data to point at your other series. That way you only have to format one chart, since the rest are just duplicates of it.

Mynda

 
Posted : 12/11/2018 6:53 pm
(@matthias)
Posts: 49
Trusted Member
Topic starter
 

Hi Mynda,

That is exactly like I did including the No Fill for the duplicated Chart - not comfortable but doable. Thanks!

In the case of Small Multiples with two rows like in your regions example, this results in 3 charts to be ajusted (w/o x axis; w/o y axis; w/o y and x axis).

Thanks again,
Matthias

 
Posted : 13/11/2018 11:37 am
(@mynda)
Posts: 4761
Member Admin
 

Yeah, unfortunately some things are still a bit laborious. You could write some VBA to automate it if it's going to be a regular task.

 
Posted : 13/11/2018 6:33 pm
(@matthias)
Posts: 49
Trusted Member
Topic starter
 

Mynda, I wish I could. 🙂

Before asking here I tried to simply print out ? ActiveChart.PlotArea.width and ? ActiveChart.PlotArea.width and then copy it to the duplicated chart(s): 

Sub PlotAreaSize()
 ActiveChart.PlotArea.Width = xy
 ActiveChart.PlotArea.Height = yz
End Sub

But it did not render the intended size. I also tried reapplying the original size with the same luck. I have probably a wrong idea about how this should work.:-(

Dim w As Variant
Dim h As Variant

w = ActiveChart.PlotArea.Width
h = ActiveChart.PlotArea.Height

 ActiveChart.Axes(xlValue).Delete
 ActiveChart.Axes(xlCategory).Delete
 ActiveChart.ChartArea.Format.Fill.Visible = msoFalse 'to check the results

ActiveChart.PlotArea.Width = w
ActiveChart.PlotArea.Height = h

 
Posted : 13/11/2018 10:20 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Matthias,

If you post your VBA and question in our VBA forum I'm sure someone will help you figure it out.

Mynda

 
Posted : 14/11/2018 12:20 am
(@matthias)
Posts: 49
Trusted Member
Topic starter
 

Hi Mynda,

Good suggestion - I posted the issue there. 

Thanks,
Matthias

 
Posted : 15/11/2018 9:31 pm
Share: