Page 1 of 1
Help getting started - TChart VCL Version
Posted: Fri Jan 07, 2022 12:34 pm
by 16492601
Hi,
I purchased TChart Pro (VCL Version) recently and I need some help in using the library effectively.
1) How do I add multiple series to a chart with each series having its own x-axis?
2) How to setup the Crosshair cursor to display BOTH X and Y values on the respective axes?
3) Is there a full-fledged example of working with a Stock chart, showing additional elements such as Moving Average, Volume, etc.?
Thanks for your help.
- Rangarajan
Re: Help getting started - TChart VCL Version
Posted: Mon Jan 10, 2022 8:53 am
by yeray
Hello,
Rangarajan wrote: ↑Fri Jan 07, 2022 12:34 pm
1) How do I add multiple series to a chart with each series having its own x-axis?
You could use custom axes as in the example
here, setting them to be
Horizontal
and using
CustomHorizAxis
instead of
CustomVertAxis
.
Code: Select all
Axis.Horizontal:=True;
Series2.CustomHorizAxis:=Axis;
Rangarajan wrote: ↑Fri Jan 07, 2022 12:34 pm
2) How to setup the Crosshair cursor to display BOTH X and Y values on the respective axes?
You could use two
TCursorTools
. Ie:
Code: Select all
with TCursorTool(Chart1.Tools.Add(TCursorTool)) do
begin
Style:=cssVertical;
AxisAnnotation.Active:=True;
end;
with TCursorTool(Chart1.Tools.Add(TCursorTool)) do
begin
Style:=cssHorizontal;
AxisAnnotation.Active:=True;
end;
Rangarajan wrote: ↑Fri Jan 07, 2022 12:34 pm
3) Is there a full-fledged example of working with a Stock chart, showing additional elements such as Moving Average, Volume, etc.?
There's a considerable amount of functions available in TeeChart so an example showing all them would be difficult to follow. We prefer showing each function independently at the Features demo shipped with the installation.
- Tee9new_2022-01-10_09-51-03.png (47.74 KiB) Viewed 11587 times
Re: Help getting started - TChart VCL Version
Posted: Mon Jan 10, 2022 1:59 pm
by 16492601
Thanks a lot!
Regarding the Features demo you have referred to, how do I open the project and build it in RAD Studio 11? I use C++ Builder and I am not that comfortable with Delphi.
- Rangarajan
Re: Help getting started - TChart VCL Version
Posted: Mon Jan 10, 2022 7:38 pm
by yeray
Hello Rangarajan,
Rangarajan wrote: ↑Mon Jan 10, 2022 1:59 pm
Regarding the Features demo you have referred to, how do I open the project and build it in RAD Studio 11? I use C++ Builder and I am not that comfortable with Delphi.
I'm afraid we are we stopped maintaining the C++Builder version of the Features Demo time ago. In general, you don't need to have experience in Delphi to understand the relevant code from the examples and translate it to C++Builder.
If you have any specific doubt, don't hesitate to let us know.
Re: Help getting started - TChart VCL Version
Posted: Tue Jan 11, 2022 1:26 am
by 16492601
A bit disappointed to hear that you do not support C++ Builder. Anyway, let me know how to build the Features demo project in RAD Studio 11 (it includes Delphi as well). Hope it is at least compatible with the latest version of RAD Studio.
- Rangarajan
Re: Help getting started - TChart VCL Version
Posted: Tue Jan 11, 2022 6:06 am
by 16492601
I implemented the technique you had suggested for "Crosshair" cursor. It turns out that this results in 2 independent cursors; moving one does not affect the other. This is not what I had in mind. "Crosshair" cursor is a single cursor that moves in both directions and shows the X and Y values on the corresponding axes. Please let me know if I missed anything.
- Rangarajan
Re: Help getting started - TChart VCL Version
Posted: Tue Jan 11, 2022 8:32 am
by 16492601
I wish to make a correction to my earlier post. After I set the "FollowMouse" property to "true" for both cursors, the behaviour is as expected. Thanks.
- Rangarajan
Re: Help getting started - TChart VCL Version
Posted: Tue Jan 11, 2022 4:18 pm
by yeray
Hello Rangarajan,
Rangarajan wrote: ↑Tue Jan 11, 2022 1:26 am
A bit disappointed to hear that you do not support C++ Builder. Anyway, let me know how to build the Features demo project in RAD Studio 11 (it includes Delphi as well). Hope it is at least compatible with the latest version of RAD Studio.
I'm sorry. Let me clarify it's just the Features Demo what we don't maintain to support C++Builder. The components should work in C++Builder.
The installation already comes with the Delphi demo precompiled. It's named "Tee9New*.exe" and you should be able to find it at the "Examples" folder.
Rangarajan wrote: ↑Tue Jan 11, 2022 6:06 am
I implemented the technique you had suggested for "Crosshair" cursor. It turns out that this results in 2 independent cursors; moving one does not affect the other. This is not what I had in mind. "Crosshair" cursor is a single cursor that moves in both directions and shows the X and Y values on the corresponding axes. Please let me know if I missed anything.
Rangarajan wrote: ↑Tue Jan 11, 2022 8:32 am
I wish to make a correction to my earlier post. After I set the "FollowMouse" property to "true" for both cursors, the behaviour is as expected. Thanks.
Yes, two
TCursorTool
s should be good to go when you want to use them with
FollowMouse
.
Instead, if you want to drag the
TCursorTool
, you'd better use only one of them (with
Style
set to
cssBoth
) and add an extra
TAnnotationTool
you'd manually control at the cursor's
OnChange
event.
Re: Help getting started - TChart VCL Version
Posted: Wed Jan 12, 2022 5:27 am
by 16492601
I was able to locate the Tee9New*.exe file in the Examples directory. It ran as expected. However, when I tried to build the corresponding project in the Examples\Features directory, I got an error "Tee9New_Icon.ico" not found. Fortunately, it was available in another folder and I copied it to this directory, and then was able to build the project. I suggest that you make sure the Examples compile and run fine when you ship them along with your product.
- Rangarajan
Re: Help getting started - TChart VCL Version
Posted: Wed Jan 12, 2022 7:27 am
by yeray
Hello Rangarajan,
Thanks for the advise. We'll check that.