Page 1 of 1
TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Wed Nov 27, 2013 9:34 am
by 16562051
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;
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Wed Nov 27, 2013 11:12 am
by narcis
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.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Thu Nov 28, 2013 1:00 am
by 16562051
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.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Thu Nov 28, 2013 1:24 am
by 16562051
Actually my release.txt shows 2013.09.131119, It's the TeeRecompile.exe that shows 2013.09.131118.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Thu Nov 28, 2013 3:25 am
by 16562051
I ran it under XE3 without any project source modification, still doesn't work.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Thu Nov 28, 2013 9:46 am
by narcis
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.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Thu Nov 28, 2013 11:58 am
by narcis
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.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Thu Nov 28, 2013 1:39 pm
by narcis
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.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Fri Nov 29, 2013 5:56 am
by 16562051
Yes! your support is appreciated.
Re: TCandleSeries: CandleWidth stop functioning after zoomed...
Posted: Fri Nov 29, 2013 8:07 am
by narcis
Hello,
You're very welcome. I'm glad to hear that helped.