TagCloud Bug

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
mihaela
Newbie
Newbie
Posts: 1
Joined: Fri Nov 07, 2008 12:00 am

TagCloud Bug

Post by mihaela » Sun Apr 12, 2009 1:51 pm

I'm having serious issues with TagCloud Series. In my application I need to start with empty series. When I try to add first tag:

Code: Select all

Series1.AddTag('FirstTag', 1);

exception occurs: "Invalid floating point operation".

Error happens inside:
TTagCloudSeries.GetTagFontSize(ValueIndex: Integer): Integer;
function:
value

Code: Select all

tmp:=MandatoryValueList.MaxValue-MandatoryValueList.Value[ValueIndex];
computes to 0, so the rsult on the next line:

Code: Select all

Dec(result, Round(0.75*tmp*FFont.Size/MandatoryValueList.Range));
is undefined.

Plese Help.

Mihaela Mihaljevic Jakic.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Apr 14, 2009 9:18 am

Hi Mihaela,

Thanks for reporting. I could reproduce the issue here and fixed it for the next maintenance release.

In the meantime you can implement GetTagFontSize like this:

Code: Select all

function TTagCloudSeries.GetTagFontSize(ValueIndex: Integer): Integer;
var tmp : Double;
begin
  result:=FFont.Size;

  tmp:=MandatoryValueList.MaxValue-MandatoryValueList.Value[ValueIndex];
  if tmp>0 then
    Dec(result, Round(0.75*tmp*FFont.Size/MandatoryValueList.Range));

  if result<1 then result:=1;
end;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply