Labels overwrite on axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Labels overwrite on axis

Post by TestAlways » Fri Oct 12, 2012 11:44 pm

XE2, TChart 2012.06.120613

I am updating my help file with some new images and see that in the old image, the X axis labels did not overwrite, but in version I am using, there is a problem with X axis labels:

Image

Is this a known issue? Any fix for it?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Labels overwrite on axis

Post by Narcís » Mon Oct 15, 2012 9:34 am

Hi TestAlways,

Which version number is the old version? Could you please attach a simple example project we can run "as-is" to reproduce the problem here and try to find a solution to it?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

TestAlways
Advanced
Posts: 228
Joined: Tue Aug 28, 2007 12:00 am
Location: Oregon, USA

Re: Labels overwrite on axis

Post by TestAlways » Mon Oct 15, 2012 2:57 pm

I don't know the version it worked right.

Demo attached.

Ed Dressel
Attachments
Label Overlap.zip
(6.15 KiB) Downloaded 2872 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Labels overwrite on axis

Post by Narcís » Tue Oct 16, 2012 9:03 am

Hi Ed,

Thanks for the example project. This was probably due to some changes to allow text labels from all series in a chart. Prior to that only text labels from the first series were plotted. You can solve the issue populating your series in a slightly different way and use series values as labels:

Code: Select all

  lIdx := 2000;

  for lYear in FYears do
  begin
    inc(lIdx);
    lsrsClientValue.AddXY(lIdx, lYear.Value1, IntToStr(lIdx));

    if lYear.Value2 > 0 then
      lsrsSpouseValue.AddXY(lIdx, lYear.Value2, IntToStr(lIdx))
    else
      lsrsSpouseValue.AddNullXY(lIdx, 0);

    if lYear.Value3 > 0 then
      lsrsBenesValue.AddXY(lIdx, lYear.Value3, IntToStr(lIdx))
    else
      lsrsBenesValue.AddNullXY(lIdx, 0);

    if lYear.Value4 > 0 then
      lsrsGrandBenes.AddXY(lIdx, lYear.Value4, IntToStr(lIdx))
    else
      lsrsGrandBenes.AddNullXY(lIdx, 0);
  end;

  chrActValues.Axes.Bottom.LabelStyle:=talValue;
Alternatively, you could keep using AddNull() and manually set bottom axis range. Find attached the project with the modifications.
Attachments
Label Overlap.zip
(76.26 KiB) Downloaded 2825 times
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply