Page 1 of 1

Incorrect axis area size when title using html

Posted: Wed Jul 05, 2017 12:06 pm
by 16578912
Hello

Incorrect axis area size (height) when title using html (Build 2017.22.170619)

Here Is a simple example

Code: Select all

__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	Chart1->View3D = false;

	TLineSeries* pTLineSeries1 = new TLineSeries(Chart1);
	Chart1->AddSeries(pTLineSeries1);
	pTLineSeries1->FillSampleValues(50);
	pTLineSeries1->XValues->DateTime=true;

	Chart1->BottomAxis->Title->Text = "Line 1<BR>Line 2";
	Chart1->BottomAxis->Title->TextFormat = ttfHtml;
	Chart1->BottomAxis->Title->Transparent = false;
	Chart1->BottomAxis->Title->Angle = 0;
	Chart1->BottomAxis->DateTimeFormat = "c";
	Chart1->BottomAxis->LabelsMultiLine = true;
	Chart1->BottomAxis->ExactDateTime = true;
	Chart1->BottomAxis->Increment = DateTimeStep[dtFifteenMinutes];
	Chart1->BottomAxis->ResizeChart = true;

	TChartAxis* pTChartAxis = Chart1->CustomAxes->Add();
	pTChartAxis->Horizontal = true;
	pTChartAxis->Title->Text = "Line 1<BR>Line 2";
	pTChartAxis->Title->TextFormat = ttfHtml;
	pTChartAxis->Title->Transparent = false;
	pTChartAxis->Title->Angle = 0;
	pTChartAxis->DateTimeFormat = "c";
	pTChartAxis->LabelsMultiLine = true;
	pTChartAxis->ExactDateTime = true;
	pTChartAxis->Increment = DateTimeStep[dtFifteenMinutes];
	pTChartAxis->ResizeChart = true;

	TLineSeries* pTLineSeries2 = new TLineSeries(Chart1);
	Chart1->AddSeries(pTLineSeries2);
	pTLineSeries2->FillSampleValues(50);
	pTLineSeries2->XValues->DateTime=true;
	pTLineSeries2->HorizAxis = aCustomHorizAxis;
	pTLineSeries2->CustomHorizAxis = pTChartAxis;
}
View before zoom
beforeZoom.png
beforeZoom.png (19.98 KiB) Viewed 5878 times
View after zoom
AfterZoom.png
AfterZoom.png (14.86 KiB) Viewed 5878 times
I also have question how to get regular and custom axis areas size when one have to manage axis position from code (ResizeChart = false)).

Best Regards,
Grzegorz

Re: Incorrect axis area size when title using html

Posted: Tue Jul 11, 2017 12:49 pm
by yeray
Hello Grzegorz,

I've reproduced the problem so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1889

Thanks for reporting it.
Technicon wrote:I also have question how to get regular and custom axis areas size when one have to manage axis position from code (ResizeChart = false)).
Take a look a the PlaceAxes method I implemented for a customer some time ago here.