fitaliano
asked on
pie charts inside a bubble chart
I have a bubble chart (see attached file). I want to display the split between "complex" and "standard" percentages (Column "F" and "G"). Is it possible to display pie charts inside this bubble charts?
Book1.xls
Book1.xls
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello,
You could create your pie charts separately, copy the pie charts as pictures and use these pictures to format each individual bubble with a picture fill from Clipboard.
This will retain the pie chart when the bubble changes position.
It will also grow or shrink with the bubble size.
But the image fills within the bubble chart are not dynamic, so if the pie charts change, you will need to re-do the image fill for the bubbles.
There's probably a way to store the images to disk and have them updated automatically via VBA and then connect each bubble with a specific image on disk.
See attached file for an implementation of the manual approach created with Excel 2010
cheers, teylyn
Book2.xlsx
You could create your pie charts separately, copy the pie charts as pictures and use these pictures to format each individual bubble with a picture fill from Clipboard.
This will retain the pie chart when the bubble changes position.
It will also grow or shrink with the bubble size.
But the image fills within the bubble chart are not dynamic, so if the pie charts change, you will need to re-do the image fill for the bubbles.
There's probably a way to store the images to disk and have them updated automatically via VBA and then connect each bubble with a specific image on disk.
See attached file for an implementation of the manual approach created with Excel 2010
cheers, teylyn
Book2.xlsx
ASKER
Thank you cslarsen,
it is the right solution. I don't think I am getting the code right though. Could you help me out?
This my code (the updated file is attached:
Sub PieMarkers()
Dim chtMarker As Chart
Dim chtMain As Chart
Dim intPoint As Integer
Dim rngRow As Range
Dim lngPointIndex As Long
Application.ScreenUpdating = False
' reference to pie chart
Set chtMarker = ActiveSheet.ChartObjects(" chtPieMark er").Chart
' reference to chart that pie markers will be applied to
Set chtMain = ActiveSheet.ChartObjects(1 ).Chart
' pie chart data which will be processed by rows
For Each rngRow In Range("A1:D6").Rows
' assign new values to pie chart
chtMarker.SeriesCollection (1).Values = rngRow
' copy pie
chtMarker.Parent.CopyPictu re xlScreen, xlPicture
' paste to appropriate data point
lngPointIndex = lngPointIndex + 1
chtMain.SeriesCollection(1 ).Points(l ngPointInd ex).Paste
Next
' release objects
Set chtMarker = Nothing
Set chtMain = Nothing
Application.ScreenUpdating = False
End Sub
Book2.xls
it is the right solution. I don't think I am getting the code right though. Could you help me out?
This my code (the updated file is attached:
Sub PieMarkers()
Dim chtMarker As Chart
Dim chtMain As Chart
Dim intPoint As Integer
Dim rngRow As Range
Dim lngPointIndex As Long
Application.ScreenUpdating
' reference to pie chart
Set chtMarker = ActiveSheet.ChartObjects("
' reference to chart that pie markers will be applied to
Set chtMain = ActiveSheet.ChartObjects(1
' pie chart data which will be processed by rows
For Each rngRow In Range("A1:D6").Rows
' assign new values to pie chart
chtMarker.SeriesCollection
' copy pie
chtMarker.Parent.CopyPictu
' paste to appropriate data point
lngPointIndex = lngPointIndex + 1
chtMain.SeriesCollection(1
Next
' release objects
Set chtMarker = Nothing
Set chtMain = Nothing
Application.ScreenUpdating
End Sub
Book2.xls
Hi f,
Ok, you have switched the name of the marker-chart and the bubble chart
(Chart 3 in the original example.)
Check this example
cheers
cslarsen
Thx for the grade
Piechart-bubble.xls
Ok, you have switched the name of the marker-chart and the bubble chart
(Chart 3 in the original example.)
Check this example
cheers
cslarsen
Thx for the grade
Piechart-bubble.xls
jppinto