Help getting started - TChart VCL Version

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Rangarajan
Newbie
Newbie
Posts: 10
Joined: Fri Dec 10, 2021 12:00 am

Help getting started - TChart VCL Version

Post by Rangarajan » Fri Jan 07, 2022 12:34 pm

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

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Help getting started - TChart VCL Version

Post by Yeray » Mon Jan 10, 2022 8:53 am

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
Tee9new_2022-01-10_09-51-03.png (47.74 KiB) Viewed 12161 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Rangarajan
Newbie
Newbie
Posts: 10
Joined: Fri Dec 10, 2021 12:00 am

Re: Help getting started - TChart VCL Version

Post by Rangarajan » Mon Jan 10, 2022 1:59 pm

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

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Help getting started - TChart VCL Version

Post by Yeray » Mon Jan 10, 2022 7:38 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Rangarajan
Newbie
Newbie
Posts: 10
Joined: Fri Dec 10, 2021 12:00 am

Re: Help getting started - TChart VCL Version

Post by Rangarajan » 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.

- Rangarajan

Rangarajan
Newbie
Newbie
Posts: 10
Joined: Fri Dec 10, 2021 12:00 am

Re: Help getting started - TChart VCL Version

Post by Rangarajan » 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

Rangarajan
Newbie
Newbie
Posts: 10
Joined: Fri Dec 10, 2021 12:00 am

Re: Help getting started - TChart VCL Version

Post by Rangarajan » 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.

- Rangarajan

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Help getting started - TChart VCL Version

Post by Yeray » Tue Jan 11, 2022 4:18 pm

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 TCursorTools 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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Rangarajan
Newbie
Newbie
Posts: 10
Joined: Fri Dec 10, 2021 12:00 am

Re: Help getting started - TChart VCL Version

Post by Rangarajan » Wed Jan 12, 2022 5:27 am

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

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Help getting started - TChart VCL Version

Post by Yeray » Wed Jan 12, 2022 7:27 am

Hello Rangarajan,

Thanks for the advise. We'll check that.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply