Page 1 of 1

Overlapping x-axis labels, how to sort bottomaxis item list

Posted: Mon Aug 26, 2013 6:16 am
by 16466844
I have a problem with overlapping x-axis labels in a set of manual series in a TDBChart (latest version).
This is a problem that came with an upgrade of a project from Delphi 7 to Delphi XE2.
It was not an issue in Delphi 7.
I've tried to manipulate the bottomaxis label items.
If they are being sorted correctly, the problem seems to be solved.
But I can't figure out how to sort this list.
Do anyone have an example of how to sort this list?
x-axisoverlap.jpg
x-axisoverlap.jpg (269.71 KiB) Viewed 2520 times
List of items in the x-axis labels
x-axisitems.jpg
x-axisitems.jpg (82.16 KiB) Viewed 2514 times

Re: Overlapping x-axis labels, how to sort bottomaxis item list

Posted: Wed Aug 28, 2013 11:42 am
by yeray
Hi,

If you know the indexes to swap, you can use the Exchange method:

Code: Select all

  Chart1.AddSeries(TBarSeries).FillSampleValues(5);

  with Chart1.Axes.Bottom.Items
  begin
    Clear;
    Add(0, 'this is'+sLineBreak+'label 0');
    Add(2, 'this is'+sLineBreak+'label 2');
    Add(1, 'this is'+sLineBreak+'label 1');
    Add(4, 'this is'+sLineBreak+'label 4');
    Add(3, 'this is'+sLineBreak+'label 3');

    Exchange(1,2);
    Exchange(3,4);
  end;
If you still find problem with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Also please, tell us what TeeChart version worked as you'd expect with Delphi 7.