Page 1 of 1

Change Color of the Lines for "Drag Marks - Tool"

Posted: Thu Oct 02, 2008 11:17 am
by 10549438
Hello,

I use the "Drag Marks - Tool" in my TChart - Application. How can I change the color of the Lines from the Series to the Dragged Marks? white.

Thanks.

Posted: Thu Oct 02, 2008 11:25 am
by narcis
Hi Woehr.Mi,

You can use tool's OnDraggedMark event like this:

Code: Select all

procedure TForm1.ChartTool1DraggedMark(Sender: TDragMarksTool;
  Index: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  Sender.Series.Marks.Arrow.Color:=clRed;
end;
However, this will change all marks arrows, not only those that have been dragged.

Posted: Thu Oct 02, 2008 11:45 am
by 10549438
Hello Narcís,

Thanks for the quick response! That's exactly what I need. But when I run this code I get a a access violation.

Another Problem that I have is:
When I drag some marks to another position and after that I start zooming or scrolling the marks stay at their absolute position (also the arrows from the Series to the Marks).

Posted: Thu Oct 02, 2008 12:06 pm
by narcis
Hi Woehr.Mi,
Thanks for the quick response! That's exactly what I need. But when I run this code I get a a access violation.
This code worked fine for me here. Which TeeChart version are you using?
Another Problem that I have is:
When I drag some marks to another position and after that I start zooming or scrolling the marks stay at their absolute position (also the arrows from the Series to the Marks).
For this to work you should set marks position to be relative to some chart object: series points, axes, legend, title, etc. So you can use custom marks position as shown in the forums threads below. You could calculate their position relative to series points.

http://www.teechart.net/support/viewtopic.php?t=4919
http://www.teechart.net/support/viewtopic.php?t=2230

Hope this helps!

Posted: Thu Oct 02, 2008 12:09 pm
by 10549438
I use TeeChartPro : v8.02.10861 Win32

Posted: Thu Oct 02, 2008 12:40 pm
by narcis
Hi Woehr.Mi,

Thanks for the information. I'll send you v8.03 installer so that you can check if it solves the problem at your end. v8.03 is a test version and we will release v8.04 very soon.

Posted: Mon Oct 06, 2008 2:44 pm
by 10549438
Hi Narcís,

Thanks for the information. I'll send you v8.03 installer so that you can check if it solves the problem at your end. v8.03 is a test version and we will release v8.04 very soon

Thanks for sending me the Version 8.03. I'll try if it works better with this Version.
For this to work you should set marks position to be relative to some chart object: series points, axes, legend, title, etc. So you can use custom marks position as shown in the forums threads below. You could calculate their position relative to series points.

http://www.teechart.net/support/viewtopic.php?t=4919
http://www.teechart.net/support/viewtopic.php?t=2230
Thanks for the links to these Forum-Threads.
But I couldn't find out how to calculate the relative positions between marks and the Series-Points.

Posted: Mon Oct 06, 2008 2:56 pm
by narcis
Hi Woehr.Mi,
But I couldn't find out how to calculate the relative positions between marks and the Series-Points.
If you look at the second page of the first thread, I posted a message doing exactly what you request.

Hope this helps!