Page 1 of 1

Associate CursorTool with a custom axis (not Axes.Left)

Posted: Tue Nov 06, 2007 8:18 am
by 9643500
Dear TeeChart Team,

May I know in details the meaning of the CursorTool.Series property. From the tutorial and help files, I can roughly guess that this property is related to the Snap something property. But I am interested in knowing whether this property is able to solve my requirement below:

I have a multiple vertical axes chart, for which only 1 of the vertical axis is visible at a time. When I add a CursorTool into the chart, it seems to me like the cursortool is always "associated" with the axis Axes.Left. I conclude so because whenever I show 1 custom axis and hide away all other axes including Axes.Left, the cursor tool's horizontal segment stops moving up and down (it just sits at the middle of the chart and is stuck there) while the vertical segment of the cursor tool can still move horizontally freely.
I need the cursortool to be associated with any of my custom vertical axis, and not just the default one Axes.Left.

So...
(1) Is my requirement possible to implement?
(2) Is CursorTool.Series property a rescue here? I tried it but it does not seem to have any effect that I can notice at all.
(3) If you know of any workaround please give me a suggestion to carry on.

Thank you.
Huy

Posted: Tue Nov 06, 2007 8:57 am
by narcis
Hi Huy,

Please find below the answers to your questions:

1. Yes, CursorTool is not associated to any axis, it is associated to a series and therefore its horizontal and vertical axes.
2. Yes, every time you switch visible axes/series you should set CursorTool.Series to the visible series.
3. That's what I suggested in question 2.

Hope this helps!

Posted: Wed Nov 07, 2007 2:52 am
by 9643500
I see. But so far I didn't use the property CursorTool.Series at all but it still works fine until my Axis.Left is set to invisible.

Does that mean by default the property is already set to some series which is associated with Axis.Left? What happens if I don't set this property like I am just forgetting about it in my current program?

Thank you.

Posted: Wed Nov 07, 2007 8:10 am
by narcis
Hi huy,

No, by default CursorTool is not set to any series and it is not a problem assigning it to a series. If you make default axes invisible the CursorTool should still be visible and active.

Posted: Thu Jul 10, 2008 6:39 am
by 14048132
Hi,
When I use this :

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right
        series.Add(1, 5)
        series.Add(2, 10)

        Dim cursorTool As New Steema.TeeChart.Tools.CursorTool(TChart1.Chart)
        cursorTool.Active = True
        cursorTool.FastCursor = True
        cursorTool.FollowMouse = True
        cursorTool.Pen.Color = Color.Red
The CursorTool's horizontal will not move.

But when series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left ,
the horizontal move freely.

What's the correct approach for setting the CursorTool?

Thank you!

Posted: Thu Jul 10, 2008 8:56 am
by narcis
Hi Chris,

You need to assign a series to the CursorTool, for example, this works:

Code: Select all

        Dim series As New Steema.TeeChart.Styles.Line(TChart1.Chart)
        series.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right
        series.Add(1, 5)
        series.Add(2, 10)

        Dim cursorTool As New Steema.TeeChart.Tools.CursorTool(TChart1.Chart)
        cursorTool.Active = True
        cursorTool.Series = series
        cursorTool.FastCursor = True
        cursorTool.FollowMouse = True
        cursorTool.Pen.Color = Color.Red