Page 1 of 1

TagCloud Bug

Posted: Sun Apr 12, 2009 1:51 pm
by 10550768
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.

Posted: Tue Apr 14, 2009 9:18 am
by narcis
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;