Page 1 of 1

Axis label height calculation does not consider multiline

Posted: Mon Nov 14, 2016 6:32 am
by 16578912
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 10135 times
Best Regards,
Grzegorz

Re: Axis label height calculation does not consider multiline

Posted: Mon Nov 14, 2016 1:11 pm
by yeray
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

Re: Axis label height calculation does not consider multiline

Posted: Mon Nov 14, 2016 1:17 pm
by yeray
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])

Re: Axis label height calculation does not consider multiline

Posted: Fri Nov 18, 2016 7:12 am
by 16578912
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 10093 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 10089 times
Best Regards,
Grzegorz

Re: Axis label height calculation does not consider multiline

Posted: Fri Nov 18, 2016 11:15 am
by yeray
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.

Re: Axis label height calculation does not consider multiline

Posted: Mon Nov 21, 2016 7:10 am
by 16578912
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

Re: Axis label height calculation does not consider multiline

Posted: Tue Nov 22, 2016 9:47 am
by yeray
Hello,

This is a different issue, so I've created a new ticket:
http://bugs.teechart.net/show_bug.cgi?id=1692