TChart.Title.Text is a TStrings class. And every TStrings instance, when its items are stuffed into a single string, has a line feed at its end:
program Project1;
uses
Classes;
var
L: TStrings;
begin
L := TStringList.Create;
L.Add('ABC');
WriteLn('---------');
WriteLn(L.Text);
WriteLn('---------');
WriteLn(L[0]);
WriteLn('---------');
ReadLn;
end.
See the empty line after the first 'ABC'? This is the same line break that you are talking abount.
As a workaround you could simply use the first element of the TStrings: Chart.Title.Text.Text[0] (but don't forget to check against an empty list: "if Chart.Title.Text.Count > 0 then...").
Or you could filter the ending linebreak from the input string before passing it to the input box:
function CleanString(AString: String): String;
begin
Result := AString;
while (Result <> '') and (Result[Length(Result)] in [#13, #10]) do
Delete(Result, Length(Result), 1);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
NewTitle: String;
begin
NewTitle := Inputbox ('New Title', 'Text', CleanString(Chart1.Title.Text.Text));
Chart1.Title.Text.Text := NewTitle;
end;
Or you could design a dedicated input form with a memo because TAChart does support multi-line titles, and there is no other way to input a multiline title at GUI level without a memo.