Scaled Rectangles in Chart

pliskers

Active Member
Joined
Sep 26, 2002
Messages
462
Office Version
  1. 2016
Platform
  1. Windows
Is there a type of chart that can create a series of rectangles, each of which has its length (along the x-axis) directed by one value in a set, and its height (along the y-axis) directed by a second? In other words, each would be a proportional rectangle with its dimensions in both directions determined by the source data.

I'm stumped - maybe because it can't be done?
 
Hi Jeff

I don't think you can do it directly with one of the native chart types. I think you must use vba to draw the rectangles yourself. Besides the Width and Height you also need the Left and Top positions. Just add the shapes to the chart. If you need help with the code, post back with details (excel version, data sample, etc.).
 
Upvote 0
As long as the rectangle does not require a fill then you can use xy-scatter.

You will need to derive, via formula, 5 sets of x & y values from a Left, Top, Height and Width set of values.
 
Upvote 0
Sounds like it might work, Andy. Can you post a sample, please?
 
Upvote 0
As long as the rectangle does not require a fill then you can use xy-scatter.

You will need to derive, via formula, 5 sets of x & y values from a Left, Top, Height and Width set of values.

Thank you for jumping in, Andy.

I was thinking of real rectangles that you could fill and add and format text and did not think of the simpler case.
 
Upvote 0
Thanks all for your help. I think I've got what I need now.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top