Page 1 of 1

Annotate, DLine, and DragMark issues

Posted: Mon Mar 18, 2013 1:21 am
by 13052810
Hello,

My program monitors for "Events" that cause TChart to place an Annotate & DLine on the graph to mark the time of the event.
I'm using the basic code Yeray provided in an earlier post, and that part seems to be working fine.

First Issue:
The problem I'm now having is that each time a new Annotate/DLine pair are generated the DLine of all previous Annotate/DLine pairs dissapears. Which ever Annotate has the focus, the accompaning DLine is visible, yet no other DLine is. Can't figure out why. What other seemingly unrelated conditions might have an effect on the DLine?

Second Issue:
Having generated a DragMark, setting it's active parameter to True, and assigned a series, I'm not able to move the Annotate/DLine pair. I have looked at the DragMarks OnDragged Demo Project, but am unable to determine how to make this work. Am I mistaken about the function of the DragMark tool?

Can someone help please?

Re: Annotate, DLine, and DragMark issues

Posted: Mon Mar 18, 2013 1:16 pm
by narcis
Hi tirby,
I'm using the basic code Yeray provided in an earlier post, and that part seems to be working fine.
I assume Yeray's example is this, right?
First Issue:
The problem I'm now having is that each time a new Annotate/DLine pair are generated the DLine of all previous Annotate/DLine pairs dissapears. Which ever Annotate has the focus, the accompaning DLine is visible, yet no other DLine is. Can't figure out why. What other seemingly unrelated conditions might have an effect on the DLine?
If I understand your problem it works with Yeray's example, doesn't it? You could check which changes have you done to the code that might have affected that.
Second Issue:
Having generated a DragMark, setting it's active parameter to True, and assigned a series, I'm not able to move the Annotate/DLine pair. I have looked at the DragMarks OnDragged Demo Project, but am unable to determine how to make this work. Am I mistaken about the function of the DragMark tool?
Yes, this is to drag standard series marks. Don't forget that the Annotation + DragLine tools combination are not original TeeChart series marks. To implement annotation dragging you should change its custom position in the OnMouseMove event or replace Annotation tools by Rectangle tools which already supports dragging. Also, find attached an old project I did to demo Annotation tool dragging.

Re: Annotate, DLine, and DragMark issues

Posted: Tue Mar 19, 2013 6:19 pm
by 13052810
So I discovered that if the color is set to vbBlack, then the line(s) will dissappear when the focus shifts to a different pair. My fix was:

Code: Select all

TChart1.Tools.Items(ToolSelected + 1).asDrawLine.Lines.Items(0).Pen.Color = vbRed
Not sure why, and I really want to set the color to Black.

The use of the Rectangle Tool works good!

Thanks

Re: Annotate, DLine, and DragMark issues

Posted: Thu Mar 21, 2013 11:45 am
by yeray
Hi tirby,
tirby wrote:Not sure why, and I really want to set the color to Black.
If you still find problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.