Page 1 of 1

Need help to draw bubble chart

Posted: Tue Apr 04, 2006 11:56 am
by 6925851
i need help to draw bubble chart for the sample data

Year units value
2001 10 9000
2002 15 50000
2003 35 30000
2004 34 5000


i dnot find any example code for drawing bubble chart ...

pls help in this regard asap

thanks & regards
aravind

Posted: Tue Apr 04, 2006 12:03 pm
by narcis
Hi Aravind,

To add bubbles in a bubble series you need to use AddBubble method:

Code: Select all

function AddBubble(AX, AY, ARadius: Double; Const AXLabel: WideString; Value: OLE_COLOR): Integer;
The AddBubble method appends a new Bubble point to the Series Points List. The Bubble point is assigned to be at AX,AY coordinates and have ARadius, Label and Color parameters. The Label parameter is used to draw Axis Labels, Bubble Marks and Legend.

So you data may be added to the series doing something like:

Code: Select all

Private Sub Form_Load()
    TChart1.Series(0).asBubble.AddBubble 2001, 10, 9000, "", clTeeColor
    TChart1.Series(0).asBubble.AddBubble 2002, 15, 50000, "", clTeeColor
    TChart1.Series(0).asBubble.AddBubble 2003, 35, 30000, "", clTeeColor
    TChart1.Series(0).asBubble.AddBubble 2004, 34, 5000, "", clTeeColor
End Sub