Page 1 of 1

Multiple TBarSeries on chart and axes

Posted: Wed Sep 04, 2024 9:09 pm
by 16597375
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.

Re: Multiple TBarSeries on chart and axes

Posted: Thu Sep 05, 2024 8:29 am
by yeray
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.

Re: Multiple TBarSeries on chart and axes

Posted: Thu Sep 05, 2024 2:17 pm
by 16597375
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?

Re: Multiple TBarSeries on chart and axes

Posted: Fri Sep 06, 2024 6:37 am
by yeray
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.