How to create oval bubble chart based on scatter chart with XY error bars?

Kelvin Stott

Active Member
Joined
Oct 26, 2010
Messages
338
Hello,

I have an XY scatter chart where each XY point has independent XY error bars. Is there any way to draw an oval around the error bars to create an oval bubble chart, where the bubble area represents the combined error?

Thanks in advance for any help.

Kelvin
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You could draw oval shapes and position them manually... tedious.

You could write a VBA program to do this programmatically... tricky but once you get the hang of it, it'll be at least more fun than manually.

However, both approaches use shapes, and if there is any change to the size of the chart or the axis scales, the shapes will no longer line up where you/VBA so neatly placed them.
 
Upvote 0
Thanks, Jon,

If there's anyone who knows how to make funky charts then it's you! :)

In fact I was hoping to do this by VBA, and I was thinking I could use event handlers to call a sub that redraws the ovals when the data is changed. Main thing I am struggling with is how to draw ovals to fit the XY error bars on a scatter chart... Could I plot a few reference points (e.g., the four corners of a rectangle) as a series, and somehow convert (or delete and replace) these to give the reference points of an oval shape, similar to how you make your funky shape plots? Could you suggest any simple code that might do this, please? I don't need perfectly working code, just enough clues to get started, thanks!

Kelvin
 
Last edited:
Upvote 0
Kelvin -

Know any algebra? You can get the plot area dimensions using PlotArea.InsideLeft, .Inside.Top, .InsideWidth, and .InsideHeight

You know where along the axes you are because you know X and Y, and you know the axis scale limits.

You can't get the error bar information directly from the chart (it's not exposed to VBA), but if the code you have built the chart and added the error bars, you can find the data.
 
Upvote 0
Thanks, I could try that, but isn't there an easier way/command to convert a plotted line into a shape, so I could just plot a rectangle, and convert that to a shape? Maybe by ungrouping the chart or something?
 
Last edited:
Upvote 0
I'd think a little algebra is easier than trying to ungroup a chart (which hasn't produced expected results since Excel 2003) and deal with the pieces. Especially since you mentioned having an event procedure to update the shapes when the data changes.

How about this: You know X and Y, and you know error bars in the X and Y direction. Why not compute the X-Y coordinates of each oval in the worksheet, and plot them onto the chart? They will automatically recompute when the values change, and they will stay in the right place on the chart when the axis scales change.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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