Hi!
I'm using a TChart with one LineSeries and a TDragPointTool but grapping the series and moving the point (I just allow moving it in Y-direction) always uses the point left of the mouse-position (in the example image, if you grap the series one pixel to the left of the y:0-mark you begin to move the y:-1 mark!!).
I think it would be good to have an option to either restrain the drag-operation to the mark itself or center the sensitiv area over a point (eg.: -0.5 to 0.5 move the y:0-mark).
I'm also missing an option to restrict movement beyond some values (like the minima/maxima of the left axis in the example). Maybe an OnDragPointAllow(Sender, Index, Var Cancel: Boolean) - event could be implemented?
TDragPointTool always favoures the "left" point
TDragPointTool always favoures the "left" point
- Attachments
-
- left.png (4.62 KiB) Viewed 3704 times
Re: TDragPointTool always favoures the "left" point
Hello,
http://bugs.teechart.net/show_bug.cgi?id=748
Feel free to add you mail to the CC list to be automatically notified when an update arrives.
I've added it to the wish list to be further investigated. I think looking for what of the two valueindex of the clicked line segment is the nearest to the mouse click should work better:Whookie wrote:I'm using a TChart with one LineSeries and a TDragPointTool but grapping the series and moving the point (I just allow moving it in Y-direction) always uses the point left of the mouse-position (in the example image, if you grap the series one pixel to the left of the y:0-mark you begin to move the y:-1 mark!!).
I think it would be good to have an option to either restrain the drag-operation to the mark itself or center the sensitiv area over a point (eg.: -0.5 to 0.5 move the y:0-mark).
http://bugs.teechart.net/show_bug.cgi?id=748
Feel free to add you mail to the CC list to be automatically notified when an update arrives.
There's a OnDragPoint event for the TDragPointTool you could use to restrict this. Ie:Whookie wrote:I'm also missing an option to restrict movement beyond some values (like the minima/maxima of the left axis in the example). Maybe an OnDragPointAllow(Sender, Index, Var Cancel: Boolean) - event could be implemented?
Code: Select all
var tmpMin, tmpMax: Double;
procedure TForm1.FormCreate(Sender: TObject);
begin
tmpMin:=Chart1[0].YValues.MinValue;
tmpMax:=Chart1[0].YValues.MaxValue;
end;
procedure TForm1.ChartTool1DragPoint(Sender: TDragPointTool;
Index: Integer);
begin
if ((Index>-1) and (Chart1[0].YValue[Index]>=tmpMax)) then
Chart1[0].YValue[Index]:=tmpMax;
if ((Index>-1) and (Chart1[0].YValue[Index]<=tmpMin)) then
Chart1[0].YValue[Index]:=tmpMin;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |