TChart axis labels overlapping when using a lot (more than 100) of TLineSeries

206 Views Asked by At

I'm dealing with an application that abuses TChart with potentially hundreds of TLineSeries. I get unreadable X axis labels, because they overlap. According to this, that shouldn't happen, but it does.

I'm now looking for a way to completely disable X axis labels derived from the TLineSeries elements and only show calculated labels at regular intervals, e.g. no labels for individual data points. How would I do that?

The misbehaving application:

enter image description here

My failed attempt to replicate the problem:

enter image description here

2

There are 2 best solutions below

0
jpo234 On BEST ANSWER

I was finally able to reproduce the problem with a small test case. Turns out that the problem was, that the application used function TChartSeries.AddXY(Const AXValue, AYValue: TChartValue; Const ALabel: String; AColor: TColor): Integer; and provided a value for ALabel. Using only X and Y values fixed the problem.

0
Brian On

If the Bottom Axis for the chart has a scale set with Automatic turned off (default is on) you can get overlap like that depending on your data, the desired increment and if Show all labels is checked.

However your example seems to show non-regular extra labels which might just be manually added using the Items (show in far right tab) or something else to add more axis labels.

enter image description here