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

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Ole Petter
Newbie
Newbie
Posts: 1
Joined: Mon Aug 19, 2013 12:00 am

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

Post by Ole Petter » Mon Aug 26, 2013 6:16 am

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 2519 times
List of items in the x-axis labels
x-axisitems.jpg
x-axisitems.jpg (82.16 KiB) Viewed 2513 times

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

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

Post by Yeray » Wed Aug 28, 2013 11:42 am

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.
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