Page 1 of 1

Labels overwrite on axis

Posted: Fri Oct 12, 2012 11:44 pm
by 10546565
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?

Re: Labels overwrite on axis

Posted: Mon Oct 15, 2012 9:34 am
by narcis
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.

Re: Labels overwrite on axis

Posted: Mon Oct 15, 2012 2:57 pm
by 10546565
I don't know the version it worked right.

Demo attached.

Ed Dressel

Re: Labels overwrite on axis

Posted: Tue Oct 16, 2012 9:03 am
by narcis
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.