TCandleSeries: CandleWidth stop functioning after zoomed...

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sswang
Newbie
Newbie
Posts: 24
Joined: Wed Mar 28, 2012 12:00 am

TCandleSeries: CandleWidth stop functioning after zoomed...

Post by sswang » Wed Nov 27, 2013 9:34 am

Hi,

In latest version, CandleWidth and AutoSize stop working after I mouse drag an area to zoom in.
These properties are working fine in older version. Please help, thanks.

to reproduce:
1. Run the code below and do some form resize, the candle width will change respectively.
2. Do a mouse zoom-in, and resize the form again, you can see the candle width stop responding.

Code: Select all

type
  TForm6 = class(TForm)
    Chart1: TChart;
    Series2: TCandleSeries;
    procedure FormCreate(Sender: TObject);
    procedure Chart1Zoom(Sender: TObject);
    procedure Chart1Resize(Sender: TObject);
  private
    const
      SAMPLE_COUNT = 10;
  public
    { Public declarations }
  end;

var
  Form6: TForm6;

implementation

{$R *.dfm}

procedure TForm6.Chart1Resize(Sender: TObject);
begin
  Series2.CandleWidth := (Chart1.Width - 250) div SAMPLE_COUNT;
end;

procedure TForm6.Chart1Zoom(Sender: TObject);
begin
  Chart1Resize(Chart1);
end;

procedure TForm6.FormCreate(Sender: TObject);
begin
  Series2.AutoSize := False;
  Series2.FillSampleValues(SAMPLE_COUNT);
end;

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

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by Narcís » Wed Nov 27, 2013 11:12 am

Hi sswang,

This works fine for me here using build 2013.09.131119 with some recent changes and the attached project. Can you please check if the project works fine for you?

Thanks in advance.
Attachments
CandleAutoSize.zip
(4.45 KiB) Downloaded 519 times
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

sswang
Newbie
Newbie
Posts: 24
Joined: Wed Mar 28, 2012 12:00 am

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by sswang » Thu Nov 28, 2013 1:00 am

Hi Narcís,

The result here is still not working, I wonder if this problem is platform dependent.
We are using D2010 here, so I have to remove all "VclTee." in source in order to compile this project .
I don't know whether or not the change I made can alter program behavior between yours and mine.

I'm using v2013.09.131118, does 2013.09.131119 contains TColorlineTool fix you send me last week?

Attached the running result from my PC FYI.
Attachments
p2.png
p2.png (86.45 KiB) Viewed 13077 times

sswang
Newbie
Newbie
Posts: 24
Joined: Wed Mar 28, 2012 12:00 am

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by sswang » Thu Nov 28, 2013 1:24 am

Actually my release.txt shows 2013.09.131119, It's the TeeRecompile.exe that shows 2013.09.131118.

sswang
Newbie
Newbie
Posts: 24
Joined: Wed Mar 28, 2012 12:00 am

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by sswang » Thu Nov 28, 2013 3:25 am

I ran it under XE3 without any project source modification, still doesn't work.

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

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by Narcís » Thu Nov 28, 2013 9:46 am

Hi sswang,
sswang wrote: The result here is still not working, I wonder if this problem is platform dependent.
I don't think so, we would expect same behavior in all platforms.
sswang wrote: I'm using v2013.09.131118, does 2013.09.131119 contains TColorlineTool fix you send me last week?
No, 2013.09.131119 is the latest maintenance release, which we published last Tuesday, 19th November 2013.
sswang wrote:Actually my release.txt shows 2013.09.131119, It's the TeeRecompile.exe that shows 2013.09.131118.
I see. Somehow TeeRecompile was not updated to 19th November version. However, this would indicate it was built on 18th November. There were only a few TeeChart source code changes, no TeeRecompile changes though.
sswang wrote:I ran it under XE3 without any project source modification, still doesn't work.
I think I didn't understand your problem correctly. After zooming I saw I could still resize the chart and the candles would also resize accordingly. However, I now understand that the problem is that candles don't resize when zooming. Is that correct? Actually, given your code, it won't work as you are using this formula:

Code: Select all

  Series1.CandleWidth := (Chart1.Width - 250) div SAMPLE_COUNT;
For this to work when zooming you should either change it to take into account bottom axis range or the number of visible points in the chart. Remember that zooming changes both axis range and number of points visible.
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

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

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by Narcís » Thu Nov 28, 2013 11:58 am

Hi sswang,
Narcís wrote: For this to work when zooming you should either change it to take into account bottom axis range or the number of visible points in the chart. Remember that zooming changes both axis range and number of points visible.
We tried to achieve that using the attached project. However, it's still not working. CandleWidth only works when axis scales are automatic (no zoom). It's a bug ([ID489]) which we will try to fix.
Attachments
CandleAutoSize.zip
(56.15 KiB) Downloaded 512 times
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

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

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by Narcís » Thu Nov 28, 2013 1:39 pm

Hello,

This has been fixed now. I'll send you the unit with the fix. Find attached the project with the modifications to make it work.
Attachments
CandleAutoSize.zip
(56.15 KiB) Downloaded 523 times
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

sswang
Newbie
Newbie
Posts: 24
Joined: Wed Mar 28, 2012 12:00 am

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by sswang » Fri Nov 29, 2013 5:56 am

Yes! your support is appreciated.

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

Re: TCandleSeries: CandleWidth stop functioning after zoomed...

Post by Narcís » Fri Nov 29, 2013 8:07 am

Hello,

You're very welcome. I'm glad to hear that helped.
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