Add Pie chart into data point marker on Line chart

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
Hi there,

I am looking for a creative way to display a pie chart within a data point marker of a line chart.

My database has 3 value columns, Type1, Type2 and the Total (Type1 + Type2)
these are recorded per day (Date, in Column A)

I have a line chart that displays the total by date, but I want to find a way to display the percentage split of a particular day by type.

I was thinking to load the chart image into the Data point marker, but i don't think that is the best way as the data is updated daily and I would have to do it each day for a few line charts.

The other way I was thinking about was to have a generic Pie chat in the Line chart (Maybe in a corner) and the pie would update depending on way date series was selected or Mouseover'd)

the way that I am approaching it at the movement (Not the best way and by far not the coolest way. Is to have a list of all the dates in a column next to the Line chart and using some VBA, what ever date is selected in the column the pie chart displays the corresponding data. But eh challenge is that when there is alot of dates, I am going to be scrolling up and down.

I am using Excel 2010, but I cant not use the slicer's as the other users do not have 2010, they have 2007.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
Hi There,

This is what I have working currently, its very slow, and not very dynamic.

The code is also a little bit messy.

Code:
Sub MyLoopForDataPoints()
Dim DataPoint As Series
Dim PieRange As Range
With Application
      .ScreenUpdating = False
      .Calculation = xlCalculationManual
End With
Set PieRange = Sheet1.Range("B2:C2")
      ActiveSheet.ChartObjects("Chart 9").Activate
      ActiveChart.SetSourceData Source:=PieRange
Set DataPoint = Sheet1.ChartObjects(1).Chart.SeriesCollection(1)
For Each Point In DataPoint.Points
      Sheet1.ChartObjects(2).Chart.SetSourceData Source:=PieRange
      Range("E23").Copy
      ActiveSheet.Pictures.Paste(Link:=True).Cut
      Point.Paste
      Set PieRange = PieRange.Offset(1, 0)
Next
With Application
      .ScreenUpdating = True
      .Calculation = xlCalculationAutomatic
      .Calculate
End With
End Sub
 

Forum statistics

Threads
1,181,759
Messages
5,931,887
Members
436,805
Latest member
waseem abbas

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
Top