Multiple TBarSeries on chart and axes

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
CPDEV
Newbie
Newbie
Posts: 2
Joined: Tue Jan 02, 2024 12:00 am

Multiple TBarSeries on chart and axes

Post by CPDEV » Wed Sep 04, 2024 9:09 pm

Using Delphi 12.1 / patch 1

Using TChart 2024.40.240410 VCL

What I am trying and failing badly at is a chart, with multiple TBarSeries. Could be 4.. could be 15... so could be many of them.

I run through a grid of data. Each rows column will plot to this chart.

So if 5 columns... 5 bars.

I do this, so i can assign a custom axes to it.

3 Custom Axes for right now to simply things

-100 to 100
0 to 15
0 to 10000

I use the max value from each column to decide which custom axis to use.

I am having a hard time getting the chart to look nice. Things over lap, ive tried changing the Multibar value and nothing seems to clean up.... I set customBarWidth to make thinner for now. But there are large gaps.

Included are 3 images... 2 of what I have going now playing around to figure this out.
Other showing my wish of how it would turn out.

Showing 3 axes on the chart and each bar series playing happy with the others on scale and positioning.

I've gone over this over and over and over... and just can't figure it out.

Code wise... everything Series and Custom Axes created at run time.

I just have a TChart on my form, and fill in the rest as needed.
Attachments
bar1.png
bar1.png (106.1 KiB) Viewed 14653 times
bar3.png
bar3.png (16.3 KiB) Viewed 14653 times
bar4.png
bar4.png (7.26 KiB) Viewed 14653 times

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

Re: Multiple TBarSeries on chart and axes

Post by Yeray » Thu Sep 05, 2024 8:29 am

Hello,

I guess the issue is you are creating too many series or too many values for each series, which reserves the space for the bars to be drawn, even if they are nulls or 0 values.
If you can arrange a simple example project we can run as-is to reproduce the problem here, we'll be pleased to give you a more concrete reply and we'll probably be able to provide a counter-example showing how to do it.
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

CPDEV
Newbie
Newbie
Posts: 2
Joined: Tue Jan 02, 2024 12:00 am

Re: Multiple TBarSeries on chart and axes

Post by CPDEV » Thu Sep 05, 2024 2:17 pm

Ill clean up my stand alone demo program and post it soon.

After thinking about it, and your response....

Possibly would it make since to have 3 custom Axes.. and 3 bar series. Each series assigned one of the custom axes.

Then whatever data comes through populate bar series it would fit under to fit the axes it would need.... so each of the 3 bar series can have X number of bars on it?

Instead of each bar getting its own series?

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

Re: Multiple TBarSeries on chart and axes

Post by Yeray » Fri Sep 06, 2024 6:37 am

CPDEV wrote:
Thu Sep 05, 2024 2:17 pm
so each of the 3 bar series can have X number of bars on it?

Instead of each bar getting its own series?
Yes, that's probably the easiest way.
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