Results 1 to 2 of 2

Thread: Bubble Chart

  1. #1
    Member Rajan_Verma's Avatar
    Join Date
    Sep 2011
    Posts
    81
    Rep Power
    14

    Bubble Chart

    Bubble chart represent Data in form of Bubble on X or Y Axis , every point of Bubble accept 3 argument X, Y and Size,

    you can refer below table to create a bubble chart.

    Name X Y Size
    A 70 40 1256
    B 46 74 1433
    C 67 94 1266
    D 58 80 884
    E 37 69 1286
    F 65 67 1196
    G 68 22 1218
    H 10 84 577
    I 56 14 1342
    J 16 28 518
    K 39 47 1609


    Here is Code to create bubble chart on single click. Name the first cell of Table as “rngRange” to refer that in code.

    Code:
    Sub CreateBubbleChart()
        
        Dim chtBubble   As Chart
        Dim rngSource   As Range
        Dim rngCell     As Range
        Dim lngSeriesCount As Long
        Dim DataLabel       As Object
     
        lngSeriesCount = 1
        Set rngSource = Intersect(Range(“rngRange”).CurrentRegion, Range(“rngRange”).CurrentRegion.Offset(1))
        Set chtBubble = Sheet1.Shapes.AddChart(xlBubble, 200, 100, 700, 300).Chart
        
        
        With chtBubble
            For Each rngCell In rngSource.Rows
                .SeriesCollection.NewSeries
                .SeriesCollection(lngSeriesCount).Name = rngCell.Cells(1).Value
                .SeriesCollection(lngSeriesCount).XValues = rngCell.Cells(2).Value
                .SeriesCollection(lngSeriesCount).Values = rngCell.Cells(3).Value
                .SeriesCollection(lngSeriesCount).BubbleSizes = rngCell.Cells(4).Value
                .SeriesCollection(lngSeriesCount).ChartType = xlBubble3DEffect
                ‘working with DataLabels
                .SeriesCollection(lngSeriesCount).ApplyDataLabels
                Set DataLabel = .SeriesCollection(lngSeriesCount).Points(1).DataLabel
                DataLabel.Left = DataLabel.Left – 40
                DataLabel.ShowSeriesName = True
                lngSeriesCount = lngSeriesCount + 1
            Next rngCell
              .HasLegend = False
        End With
        
    End Sub
    http://excelpoweruser.wordpress.com/.../bubble-chart/

    Thanks for Reading
    Rajan.
    Last edited by Admin; 09-04-2012 at 08:59 AM.

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Excel Chart Showing Values on Angle: Nightingale Chart
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 10-17-2012, 06:39 PM
  2. Create Bubble Chart Automatically
    By Excel Fox in forum Download Center
    Replies: 7
    Last Post: 08-12-2012, 10:39 PM
  3. Replies: 1
    Last Post: 05-20-2012, 12:23 PM
  4. 2007 PPT Chart Data is not Reflecting In Chart
    By littleiitin in forum Powerpoint Help
    Replies: 2
    Last Post: 04-28-2012, 01:42 PM
  5. Bubble Sort Function
    By PcMax in forum Excel Help
    Replies: 5
    Last Post: 12-15-2011, 11:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •