Hello,
When adding a bubble to a TBubbleSeries, you specify the color. How can I specify that I want a particular bubble to be unfilled. i.e. the border of of the bubble should be there, but there should be no fill. I want to use this to indicate the value the bubble is supposed to represent is undefined (i.e. NAN). All the rest of the bubbles should be colored like normal.
How to add an unfilled bubble to a TBubbleSeries
Re: How to add an unfilled bubble to a TBubbleSeries
Hello David,
You can use null points (clNone color) in conjunction with OnGetPointerStyle as follows:
You can use null points (clNone color) in conjunction with OnGetPointerStyle as follows:
Code: Select all
uses BubbleCh, Series;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
tmpColor: TColor;
begin
Chart1.View3D:=false;
with Chart1.AddSeries(TBubbleSeries) as TBubbleSeries do
begin
for i:=0 to 9 do
begin
if i=5 then
tmpColor:=clNone
else
tmpColor:=clTeeColor;
AddBubble(i, random*1000, (1000/15.0)+Round(1000/(10+random*15)), '', tmpColor);
end;
OnGetPointerStyle:=BubbleGetPointerStyle;
end;
end;
function TForm1.BubbleGetPointerStyle(Sender:TChartSeries; ValueIndex:Integer):TSeriesPointerStyle;
begin
if Sender is TBubbleSeries then
with Sender as TBubbleSeries do
begin
if IsNull(ValueIndex) then
Pointer.Brush.Style:=bsClear
else
Pointer.Brush.Color:=Sender.ValueColor[ValueIndex];
Result:=Pointer.Style;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to add an unfilled bubble to a TBubbleSeries
Hi Yeray,
Thank you. That should work.
Thank you. That should work.