Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Bubble Charts
Hi, hope someone can help me I was using the following VBA code (http://blogs.msdn.com/b/tomholl/arch...-in-excel.aspx) to graph a bubble chart in excel but the problem is that the small bubble got hide by a larger bubble after run the code.
Please help Regards, Public Sub CreateMultiSeriesBubbleChart() If (Selection.Columns.Count < 4 Or Selection.Rows.Count < 3) Then MsgBox "Selection must have 4 columns and at least 2 rows" Exit Sub End If Dim bubbleChart As ChartObject Set bubbleChart = ActiveSheet.ChartObjects.Add(Left:=Selection.Left, Width:=600, Top:=Selection.Top, Height:=400) bubbleChart.Chart.ChartType = xlBubble Dim r As Integer For r = 2 To Selection.Rows.Count With bubbleChart.Chart.SeriesCollection.NewSeries .Name = "=" & Selection.Cells(r, 1).Address(External:=True) .XValues = Selection.Cells(r, 2).Address(External:=True) .Values = Selection.Cells(r, 3).Address(External:=True) .BubbleSizes = Selection.Cells(r, 4).Address(External:=True) End With Next bubbleChart.Chart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis) bubbleChart.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Text = "=" & Selection.Cells(1, 2).Address(External:=True) bubbleChart.Chart.SetElement (msoElementPrimaryValueAxisTitleRotated) bubbleChart.Chart.Axes(xlValue, xlPrimary).AxisTitle.Text = "=" & Selection.Cells(1, 3).Address(External:=True) bubbleChart.Chart.SetElement (msoElementPrimaryCategoryGridLinesMajor) bubbleChart.Chart.Axes(xlCategory).MinimumScale = 0 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Bubble Charts | Charts and Charting in Excel | |||
Bubble Charts | Excel Discussion (Misc queries) | |||
Bubble Charts | Charts and Charting in Excel | |||
Bubble Charts | Charts and Charting in Excel | |||
Bubble charts | Charts and Charting in Excel |