TSubChartTool and center title without AdjustFrame
Posted: Wed Jun 28, 2017 3:32 pm
Hi,
I want to center the title of my subgraph with AdjustFrame = false.
I use this code:
In this situation, the title is not centered above my graph, as you can see in the attachment file.
While waiting for the bug fix, is there a solution ?
I want to center the title of my subgraph with AdjustFrame = false.
I use this code:
Code: Select all
TChart * Chart1 = new TChart(this);
Chart1->Parent = this;
Chart1->Align = alClient;
TSubChartTool *SubChart1 = new TSubChartTool(NULL);
Chart1->Tools->Add(SubChart1);
TChart * Chart2 = SubChart1->Charts->AddChart("MySubChart");
Chart2->AddSeries(new TPointSeries(Chart1))->FillSampleValues();
Chart2->Legend->Visible = true;
Chart2->Title->Caption = "SubChart Title";
Chart2->Title->Visible = true;
Chart2->Title->AdjustFrame = false;
SubChart1->Charts->Items[0]->Left = SubChart1->ParentChart->Width / 2;
SubChart1->Charts->Items[0]->Width = SubChart1->ParentChart->Width / 2;
While waiting for the bug fix, is there a solution ?