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

Time:01-05

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 enter image description here

My failed attempt to replicate the problem:

enter image description here

CodePudding user response:

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

CodePudding user response:

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.

  • Related