Hi,
apologise if this question was already addressed, but how can I set an offset to an axis title? How can I do that?
thanks in advance
x-axis title offset
x-axis title offset
thanks,
Nabil Ghodbane (PhD. Habil)
Nabil Ghodbane (PhD. Habil)
Re: x-axis title offset
Hello,
I'm afraid the automatic alignment doesn't allow offsets. Instead, you could use a custom position:
I'm afraid the automatic alignment doesn't allow offsets. Instead, you could use a custom position:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Title.CustomPosition:=true;
Chart1.Title.Left:=100;
Chart1.Title.Top:=50;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: x-axis title offset
Hi,
thanks for the prompt reply, but my question was about the position of the axis label, not the chart title.
I need to have:
chart1.BottomAxis.Title.Caption := 'bla';
I want to change the position of this label. How can I do this?
thanks, nabil
thanks for the prompt reply, but my question was about the position of the axis label, not the chart title.
I need to have:
chart1.BottomAxis.Title.Caption := 'bla';
I want to change the position of this label. How can I do this?
thanks, nabil
Re: x-axis title offset
Hi Nabil,
Oups, I misread that.cssesuc wrote:thanks for the prompt reply, but my question was about the position of the axis label, not the chart title.
I'm afraid that's not possible. Instead, you should use an annotation tool and set its position manually.cssesuc wrote:I need to have:
chart1.BottomAxis.Title.Caption := 'bla';
I want to change the position of this label. How can I do this?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: x-axis title offset
thanks for the reply. Sorry, I am not familiar with the TeeChart library yet.
You write: "you should use an annotation tool and set its position manually."
could you provide me with some lines of code on how to implement that for the bottom axis?
thanks for your valuable help
You write: "you should use an annotation tool and set its position manually."
could you provide me with some lines of code on how to implement that for the bottom axis?
thanks for your valuable help
thanks,
Nabil Ghodbane (PhD. Habil)
Nabil Ghodbane (PhD. Habil)
Re: x-axis title offset
Hello,
Here you are:
Here you are:
Code: Select all
uses Series, TeeTools;
var annot1: TAnnotationTool;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.AddSeries(TBarSeries).FillSampleValues;
annot1:=Chart1.Tools.Add(TAnnotationTool) as TAnnotationTool;
with annot1 do
begin
Text:='This is a bottom axis title with offset';
Shape.Transparent:=true;
end;
end;
procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
var xOffset, tmpWidth, tmpHeight: Integer;
begin
xOffset:=10;
annot1.Shape.CustomPosition:=true;
tmpWidth:=annot1.Width;
tmpHeight:=annot1.Height;
Chart1.Canvas.AssignFont(annot1.Shape.Font);
if tmpWidth=0 then
tmpWidth:=Chart1.Canvas.TextWidth(annot1.Text);
if tmpHeight=0 then
tmpHeight:=Chart1.Canvas.TextHeight(annot1.Text);
annot1.Left:=Chart1.Axes.Bottom.IStartPos + Chart1.Axes.Bottom.IAxisSize div 2 - tmpWidth div 2 + xOffset;
annot1.Top:=Chart1.Height - tmpHeight - 10;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: x-axis title offset
Hi could you send me the entire project to check, because it simply fails. I am wondering whether it comes from some misconfiguration at my side.
thanks
thanks
thanks,
Nabil Ghodbane (PhD. Habil)
Nabil Ghodbane (PhD. Habil)
Re: x-axis title offset
Hello,
Here it is: At designtime I only dropped into the form, aligned the chart to alClient and assigned FormCreate and Chart1BeforeDrawSeries events.
Here it is: At designtime I only dropped into the form, aligned the chart to alClient and assigned FormCreate and Chart1BeforeDrawSeries events.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |