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 - [TV52015115] http://www.teechart.net/support/viewtopic.php?f=3&t=11330&view=unread...
Summary: [TV52015115] http://www.teechart.net/support/viewtopic.php?f=3&t=11330&view=u...
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: Series (show other bugs)
Version: unspecified
Hardware: All All
: Normal enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 14:20 EDT by yeray alonso
Modified: 2013-11-20 10:03 EST (History)
0 users

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)]