Axis label height calculation does not consider multiline

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Technicon
Newbie
Newbie
Posts: 43
Joined: Thu Aug 11, 2016 12:00 am
Contact:

Axis label height calculation does not consider multiline

Post by Technicon » Mon Nov 14, 2016 6:32 am

Hi,

Axis label height calculation does not consider multiline. When I add SrollPager and axis is multiline there is not enough place to display labels correctly.
scrollpagermultiline.png
scrollpagermultiline.png (123.41 KiB) Viewed 10196 times
Best Regards,
Grzegorz

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

Re: Axis label height calculation does not consider multiline

Post by Yeray » Mon Nov 14, 2016 1:11 pm

Hello Grzegorz,

I could reproduce it (without using scrollpager tool) so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1684
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

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

Re: Axis label height calculation does not consider multiline

Post by Yeray » Mon Nov 14, 2016 1:17 pm

Hello Grzegorz,

I fixed it for the next maintenance release.
Since you are a source code customer, you could apply the modification in your sources (and recompile them). At the TChartAxis.GetAxisSeriesLabel function in TeEngine.pas you'll find:

Code: Select all

talPointValue : if MandatoryAxis=Self then // DB
                   ALabel:=LabelValue(MandatoryValueList.Value[AIndex])
                else
                   ALabel:=LabelValue(NotMandatoryValueList.Value[AIndex])
Add "talValue" so it ends looking like this:

Code: Select all

talPointValue,
     talValue : if MandatoryAxis=Self then // DB
                   ALabel:=LabelValue(MandatoryValueList.Value[AIndex])
                else
                   ALabel:=LabelValue(NotMandatoryValueList.Value[AIndex])
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

Technicon
Newbie
Newbie
Posts: 43
Joined: Thu Aug 11, 2016 12:00 am
Contact:

Re: Axis label height calculation does not consider multiline

Post by Technicon » Fri Nov 18, 2016 7:12 am

Hello,

I've apply Your fix but there is some more problems especially when one enable axis title.
Here is an example

Code: Select all

	TChartSeries* pTChartSeries = Chart1->AddSeries(new TLineSeries(Chart1));
	if(pTChartSeries)
	{
		dynamic_cast<TLineSeries*>(pTChartSeries)->Stairs = true;

		pTChartSeries->Title = "Series" + IntToStr(Chart1->SeriesCount() - 1);
		pTChartSeries->XValues->DateTime=true;
		pTChartSeries->FillSampleValues(100);
	}

	Chart1->BottomAxis->ExactDateTime = true;
	Chart1->BottomAxis->Increment = DateTimeStep[dtFifteenMinutes];
	Chart1->BottomAxis->DateTimeFormat = "c";
	Chart1->BottomAxis->LabelsMultiLine = true;

	Chart1->BottomAxis->Title->Caption = "Axis Title";
	Chart1->BottomAxis->Title->Visible = true;
	Chart1->BottomAxis->Title->Transparent = false;
	Chart1->BottomAxis->Title->Color = clRed;
When chart is unzoomed it looks like this
unzoom.png
unzoom.png (25.4 KiB) Viewed 10154 times
There is a lot of free space below axis titile

When one try to zoom and labels are really multiline labels are cover axis title.
zoom.png
zoom.png (22.13 KiB) Viewed 10150 times
Best Regards,
Grzegorz

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

Re: Axis label height calculation does not consider multiline

Post by Yeray » Fri Nov 18, 2016 11:15 am

Hello Grzegorz,

I could reproduce the problem you are reporting so I've re-factored the fix for #1684.
Since you own the Source Code I'll send a mail with the modified TeEngine.pas unit to the mail you have registered in this forum.
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

Technicon
Newbie
Newbie
Posts: 43
Joined: Thu Aug 11, 2016 12:00 am
Contact:

Re: Axis label height calculation does not consider multiline

Post by Technicon » Mon Nov 21, 2016 7:10 am

Hello,

The fix that You send me works, but only for standard axis. On custom axis title overlap labels when multiline is enabled.


Best Regards,
Grzegorz

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

Re: Axis label height calculation does not consider multiline

Post by Yeray » Tue Nov 22, 2016 9:47 am

Hello,

This is a different issue, so I've created a new ticket:
http://bugs.teechart.net/show_bug.cgi?id=1692
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