TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
EdDressel
- Newbie

- Posts: 32
- Joined: Mon Dec 10, 2018 12:00 am
Post
by EdDressel » Thu Oct 17, 2019 4:50 pm
I create software for retirement planning. I have one scenario where two charts (2 TChart objects) are shown (both on the screen and in a report) that shows income on the top and balances down below (see below).
There is no need to have two legends showing--I only need one at the bottom, but the bottom chart may not have all of the accounts.
1) Is there a way to show a single legend with elements from both charts?
2) You may answer this in the question above, but just in case you don't: I also output my charts to images that I put in a report (ReportBuilder). I have one page that shows both retirement--can I create an image of just a legend?
Much appreciated,
Ed Dressel
Thanks,
Ed Dressel
-
Yeray
- Site Admin

- Posts: 9643
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Mon Oct 21, 2019 1:09 pm
Hello,
You can hide the legend in the chart on the top and make sure the chart on the bottom has as many series as you want to be shown in the legend. Note some of these series may have no points but the series title.
-
EdDressel
- Newbie

- Posts: 32
- Joined: Mon Dec 10, 2018 12:00 am
Post
by EdDressel » Tue Oct 22, 2019 2:04 pm
Thank you for your reply.
I would like to "balance" the two charts--so they are the same height. If the second one has the legend, is this possible?
Thanks,
Ed Dressel
-
Yeray
- Site Admin

- Posts: 9643
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Wed Oct 23, 2019 6:59 am
Hello,
I see two options.
You could modify the height of the TChart components so the heights of both ChartRects (automatically calculated) match.
Alternatively, if you need to have the same height in both TChart components, or if the ChartRects automatically generated can give different height for different runs/data, you could use a CustomChartRect in one of your charts. Something similar to this:
Code: Select all
Chart1.CustomChartRect := True;
Chart1.ChartRect := Chart2.ChartRect;