Hi,
I would like to do something like in the picture.
From my research, it uses TColorLineTool. But I don't know how to add a label on the hori line. The label holds the value of left axis value point. You can move the hori line. You can also type the value in the label and the line moves to that value.
Is that builtin feature from TeeChar pro 2012?
How do i implement it?
Regards,
TColorLineTool with label
-
- Newbie
- Posts: 16
- Joined: Wed May 18, 2005 4:00 am
- Location: Sydney, Australia
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TColorLineTool with label
Hi Matt,
You can use a TColorLineTool in synch with a TAnnotationTool as shown in the attached project. You could also do custom text drawing directly to TeeChart's canvas in the OnAfterDraw event, for example.
Hope this helps!
You can use a TColorLineTool in synch with a TAnnotationTool as shown in the attached project. You could also do custom text drawing directly to TeeChart's canvas in the OnAfterDraw event, for example.
Hope this helps!
- Attachments
-
- ColorlineWithAnnotation.zip
- (2.39 KiB) Downloaded 584 times
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: TColorLineTool with label
Hello,
Sorry, I forgot to answer that part:
Sorry, I forgot to answer that part:
Currently there's no built-in functionality to do that. Rectangle tool, similar to Annotation tool, supports editing with TeeChart for .NET. I have added this (TV52016160) to the wish-list to be considered for inclusion in future releases. In the meantime, the only option I can think of is using a TEdit which modifies both the ColorLine.Value and Annotation.Text. You could make that TEdit only visible when clicking in the Annotation tool using the OnClick or OnDblClick events. You could also position it in the Annotation tool position. I already showed you how to get and set its position.You can also type the value in the label and the line moves to that value.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 16
- Joined: Wed May 18, 2005 4:00 am
- Location: Sydney, Australia
- Contact:
Re: TColorLineTool with label
Hi Narcis,Narcís wrote:Hi Matt,
You can use a TColorLineTool in synch with a TAnnotationTool as shown in the attached project. You could also do custom text drawing directly to TeeChart's canvas in the OnAfterDraw event, for example.
Hope this helps!
The example is perfectly working and great one. But if you zoom-in the graph, the annotation is still hanging on the same place. I tired to work around to get proper position of annotation. But I don't know how to get Top and Left of annotation.
Do you know how to set the annotation on the TColorLineTool when you zoom-in.
Thanks for advice and explanation. Thanks againNarcís wrote:Hello,
Currently there's no built-in functionality to do that. Rectangle tool, similar to Annotation tool, supports editing with TeeChart for .NET. I have added this (TV52016160) to the wish-list to be considered for inclusion in future releases. In the meantime, the only option I can think of is using a TEdit which modifies both the ColorLine.Value and Annotation.Text. You could make that TEdit only visible when clicking in the Annotation tool using the OnClick or OnDblClick events. You could also position it in the Annotation tool position. I already showed you how to get and set its position.
Regards
Re: TColorLineTool with label
Hi,
To update the annotation position afterzooming/unzooming/scrolling you should use the according event to move it as Narcís did in the example above. For example, you could enhance it with this:Matt Venkat wrote:The example is perfectly working and great one. But if you zoom-in the graph, the annotation is still hanging on the same place. I tired to work around to get proper position of annotation. But I don't know how to get Top and Left of annotation.
Code: Select all
procedure TForm1.Chart1Zoom(Sender: TObject);
begin
Chart1.Draw;
UpdateAnnotationPosition(ChartTool1.Value, ChartTool2);
end;
procedure TForm1.Chart1UndoZoom(Sender: TObject);
begin
Chart1.Draw;
UpdateAnnotationPosition(ChartTool1.Value, ChartTool2);
end;
procedure TForm1.Chart1Scroll(Sender: TObject);
begin
UpdateAnnotationPosition(ChartTool1.Value, ChartTool2);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 16
- Joined: Wed May 18, 2005 4:00 am
- Location: Sydney, Australia
- Contact:
Re: TColorLineTool with label
Thank alot Yeray. It works fine now.Yeray wrote:Hi,
To update the annotation position afterzooming/unzooming/scrolling you should use the according event to move it as Narcís did in the example above. For example, you could enhance it with this:Code: Select all
Chart1.Draw;
Chart1.Draw fixes the problem.
Thanks again.
Cheers