Page 1 of 1

bubble labeling w/delphi

Posted: Sun Nov 23, 2008 1:49 pm
by 10050941
1) how to add a label to bubble if label field name is "NAME"?

Code: Select all

with dbf1 do begin
 dbffilename:=ExtractFilePath(Application.ExeName) + 'selected.dbf';
 active:=true;
  Chart1.View3D:=false;
 Series1:=TBubbleSeries.Create(self);
 Chart1.AddSeries(Series1);
  for i := 0 to 15 do
  begin
    name:=getcfield('name');
    x:=i;
    y:=getrealfield('y'); 
    radius:=0.001*getrealfield('x'); 
    Series1.addbubble(
    x,y,radius,inttostr(i));
    skip(1);
  end;
 end;
2) how to enable click on a bubble to show "name" value?

Thank you.

Hi!

Posted: Mon Nov 24, 2008 9:40 am
by 10050769
Hi! kualoa1

You just need to use AddBubble method override which adds a label for each bubble, which you already do. For example:

Code: Select all

  Series1.AddBubble(X,Y,Radius,YourLabelString);
Then you may also need to set series marks visible:

Code: Select all

  Series1.Marks.Visible:=true;


2)

if you want bubble show "name" value when clik the bubble you need to add Mark Tips that you can find at the Chart editor in the "Tools" tab.Alse can find some exemples in new Features Demo.

Sandra

Hope this helps!

Sandra