TCursorTool
Posted: Sat Jan 29, 2005 1:00 am
I'm displaying a TCursorTool crosshair cursor on my chart. How do I get rid of the 'regular' cursor that is displayed as well? It looks strange to have them both displayed at the same time?
Code: Select all
Chart1.OriginalCursor := crNone;
Thanks, Marjan. Works great.Marjan wrote:Try setting TChart.OriginalCursor property to crNone:Code: Select all
Chart1.OriginalCursor := crNone;
The easiest approach would be to use the "Object Inspector" and change the ChartTool1 Name to something else (can be done at design time).How can I specify the TCursorTool's name?
Hmm.. Perhaps by using two cursors, vertical and horizontal ? Set the vertical cursor Snap and FollowMouse properties to True and Horizontal cursor FollowMouse property to True:And one more quick question - How can I get the crosshair cursor to snap to the X axis but not the Y axis?
Code: Select all
With CursorTool1 do
begin
FollowMouse := True;
Series := Series1;
Snap := True;
Style := cssVertical;
end
With CursorTools2 do
begin
FollowMouse := True;
Series := Series1;
Style := cssHorizontal;
end
I feel a bit silly asking this, but how do I get it displayed in the Object Inspector? I tried opening the Chart Editor (by double-clicking on the chart on my form), then clicking on the Tools Tab, then on my Cursor in the left-hand panel, but it does not appear in the Object Inspector.Marjan wrote:The easiest approach would be to use the "Object Inspector" and change the ChartTool1 Name to something else (can be done at design time).How can I specify the TCursorTool's name?
OK, I'll give this a try.Marjan wrote:Hmm.. Perhaps by using two cursors, vertical and horizontal ? Set the vertical cursor Snap and FollowMouse properties to True and Horizontal cursor FollowMouse property to True:And one more quick question - How can I get the crosshair cursor to snap to the X axis but not the Y axis?Code: Select all
With CursorTool1 do begin FollowMouse := True; Series := Series1; Snap := True; Style := cssVertical; end With CursorTools2 do begin FollowMouse := True; Series := Series1; Style := cssHorizontal; end