Page 1 of 1

Dragmarks

Posted: Mon Aug 14, 2006 4:01 pm
by 9231397
In the Teechart Demo exe provided with install, under /tools/dragmarks, if a mark is dragged and then the chart is resized/moved (with right mouse bttn) or zoomed, the dragged mark doesn't track the chart the same as the undragged marks do. Is there an easy way I can make my marks track the zoom or chart size/position change?

The other problem I'm haing is the lengtr of the line between the mark and the point (tlineseries), the marks.arrowlength does not seem to be affecting this?

thanks
Sean.

Posted: Mon Aug 14, 2006 5:23 pm
by 9231397
I should add that the series I am attaching marks to are created in code with

myrig[1]:=Tchartshape.Create(self);
chart.AddSeries(myrig[1]);
.
.
with myrig[1] do
begin
marks.shapestyle:=fosRoundRectangle;
marks.Visible:=true;
marks.Callout.Color:=clblue;
Marks.Arrow.Color:=clblue;
Marks.ArrowLength:=90; ------has no effect
Marks.Callout.Visible:=true;
marks.callout.Length:=0; -----has no effect
Marks.callout.Visible:=true; //this is the small triangle
Marks.Callout.distance:=0;
end

Posted: Wed Aug 16, 2006 11:14 am
by Pep
Hi Sean,
In the Teechart Demo exe provided with install, under /tools/dragmarks, if a mark is dragged and then the chart is resized/moved (with right mouse bttn) or zoomed, the dragged mark doesn't track the chart the same as the undragged marks do. Is there an easy way I can make my marks track the zoom or chart size/position change?
True. Since series marks custom positions are expressed in screen pixels, they stay the same if you zoom/scroll. A workoarund is to express and store series marks positions in axis values (doubles) and then in one of the TChart events read and translate these values back to screen pixels. This way custom positions will be updated with zoom/scroll (whenever chart is repainted).
There are several ways how to do this (derive new tool, store values in separate array, ...). I think we already have this on our to-do list for
next major release.
The other problem I'm haing is the lengtr of the line between the mark and the point (tlineseries), the marks.arrowlength does not seem to be affecting this?
Using the following code works fine here :
Series1.Marks.ArrowLength:=0;

Re: Dragmarks

Posted: Fri Apr 13, 2012 4:22 pm
by 16555900
The problem is still not solved in version 2012. Is even worser, because all marks placed at right side from the draged mark do not move and stay at the place. That can be checked in the provided Demo.

I have one more problem with moved marks. Not all points in my series have associated marks. Thus, when I use the statement Marks.ResetPositions I receive EAccessViolation error. I cannot find solution of the problem. Any suggestion will be appreciated.

Stanislaw

Re: Dragmarks

Posted: Fri Apr 13, 2012 4:44 pm
by 16555900
The second problem is solved (beter or worser) by code

with Series4 do if Active then begin
for i:= 0 to Count-1 do Marks.Positions.Automatic(i);
Repaint;
end;

Stanislaw

Re: Dragmarks

Posted: Mon Apr 16, 2012 11:16 am
by yeray
Hi Stainslaw,

Here you can find a workaround suggested for this.
http://www.teechart.net/support/viewtop ... ll*#p34033

Don't hesitate to let us know if you still have problems with it.