Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 202

Summary: [TV52015115] http://www.teechart.net/support/viewtopic.php?f=3&t=11330&view=unread...
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: CONFIRMED ---    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2013-11-20 10:03:18 EST
http://www.teechart.net/support/viewtopic.php?f=3&t=11330&view=unread#p48847
I've made some adjustments to BubbleCH.pas I'd like to share with you. You may consider takem them into a next release. The changes implement a 'RadiusScaleFactor' which allows (display) scaling of the bubbles whilst still keeping the original radius values. My 1st choice would be to have a separate axis for the bubble radius, but I can live with thios solution too.
// changes to the class TBubbleSeries
private
{$ifdef HH_PATCH_TC_BUBBLE}
    FRadiusScaleFactor : double;
{$endif}
protected
{$ifdef HH_PATCH_TC_BUBBLE}
    procedure SetRadiusScaleFactor(aFactor:double);
    function HasRadiusScaleFactor:boolean;
{$endif}
published
{$ifdef HH_PATCH_TC_BUBBLE}
    property RadiusScaleFactor:double read FRadiusScaleFactor write SetRadiusScaleFactor stored HasRadiusScaleFactor;
{$endif}
// changes made to implementation
constructor
{$ifdef HH_PATCH_TC_BUBBLE}
  FRadiusScaleFactor :=1.0;
{$endif}
Procedure TBubbleSeries.PreparePointer(ValueIndex:Integer);
var tmpSize : Integer;
begin
{$ifdef HH_PATCH_TC_BUBBLE}
  tmpSize:=GetVertAxis.CalcSizeValue(RadiusValues.Value[ValueIndex]*RadiusScaleFactor);
{$else}
  tmpSize:=GetVertAxis.CalcSizeValue(RadiusValues.Value[ValueIndex]);
{$endif}
...
// applyradius
  if Increment then
     result:=Math.Max(result,AList.Value[t]+RadiusValues.Value[t]{$ifdef HH_PATCH_TC_BUBBLE}*RadiusScaleFactor{$endif})
  else
     result:=Math.Min(result,AList.Value[t]-RadiusValues.Value[t]{$ifdef HH_PATCH_TC_BUBBLE}*RadiusScaleFactor{$endif});
// Assign
{$ifdef HH_PATCH_TC_BUBBLE}
  if Source is TBubbleSeries then
     FRadiusScaleFactor:=TBubbleSeries(Source).FRadiusScaleFactor;
{$endif}
// 2 new routines
{$ifdef HH_PATCH_TC_BUBBLE}
procedure TBubbleSeries.SetRadiusScaleFactor(aFactor:double);
begin
  if FRadiusScaleFactor<>aFactor then
  begin
    if aFactor<=0 then
      raise ChartException.CreateFmt('%s.SetRadiusScaleFactor(%n) in valid value',[ClassName,aFactor])
    else
    begin
      FRadiusScaleFactor:=aFactor;
      Repaint;
    end;
  end;
end;
function TBubbleSeries.HasRadiusScaleFactor:boolean;
begin
  Result:=FRadiusScaleFactor<>1.0;
end;
{$endif}
 [created:2010-08-27T13:20:20.000+01:00 reported by:yeray@steema.com reported in version:9.0 (TeeChart VCL)]