Page 1 of 1

Cursor Tool & Clipping

Posted: Wed Dec 08, 2004 10:11 am
by 9083304
Hi

Drawing a financial chart on default axes, I then add a volume graph on a custom axis directly below and sharing the same bottom axis. When I add a vertical teeCursor it only appears in the primary graph not for the custom axis. Is there a way to make the line simply extend for the full length of the Chart canvas? Hope this makes sense.

'Clipping Nodes'

Posted: Wed Dec 08, 2004 10:14 am
by 9083304
Sorry, forgot to add my question about 'clipping'. If user clicks on a series line I want to show nodes along the line to indicate it is the selectedf series, like you would see in a drawing app. Is there an easy way to do this?

Posted: Mon Dec 13, 2004 8:10 am
by Pep
Hi,
custom axis. Is there a way to make the line simply extend for the full length of the Chart canvas? Hope this makes sense.
The best way to do this is to use another Cursor tool for the other Serie like in the following code :

Code: Select all

Private Sub Form_Load()
With TChart1
    .Aspect.View3D = False
    .AddSeries scCandle
    .Series(0).FillSampleValues (25)
    .Axis.Left.EndPosition = 75
    .AddSeries scVolume
    .Series(1).FillSampleValues (25)
    a = .Axis.AddCustom(False)
    .Axis.Custom(a).StartPosition = 75
    .Axis.Custom(a).EndPosition = 100
    .Series(1).VerticalAxisCustom = a
    .Tools.Add tcCursor
    .Tools.Items(0).asTeeCursor.Series = TChart1.Series(0)
    .Tools.Items(0).asTeeCursor.Style = cssVertical
    .Tools.Items(0).asTeeCursor.FollowMouse = True
    .Tools.Items(0).asTeeCursor.Series = TChart1.Series(0)
    
    .Tools.Add tcCursor
    .Tools.Items(1).asTeeCursor.Series = TChart1.Series(1)
    .Tools.Items(1).asTeeCursor.Style = cssVertical
    .Tools.Items(1).asTeeCursor.FollowMouse = True
    .Tools.Items(1).asTeeCursor.Series = TChart1.Series(1)
End With
End Sub

Private Sub TChart1_OnCursorToolChange(ByVal Tool As Long, ByVal X As Long, ByVal Y As Long, ByVal XVal As Double, ByVal YVal As Double, ByVal Series As Long, ByVal ValueIndex As Long)
If Tool = 0 Then
    TChart1.Tools.Items(1).asTeeCursor.XVal = TChart1.Tools.Items(0).asTeeCursor.XVal
Else
    TChart1.Tools.Items(0).asTeeCursor.XVal = TChart1.Tools.Items(1).asTeeCursor.XVal
End If
End Sub
or use the Canvas techniques to draw a line over the Chart.

Posted: Mon Dec 13, 2004 8:16 am
by Pep
Hi,
Sorry, forgot to add my question about 'clipping'. If user clicks on a series line I want to show nodes along the line to indicate it is the selectedf series, like you would see in a drawing app. Is there an easy way to do this?
How about using the SelectorTool (only avaiable at design time for the momment) ?
It will be available at runtime for the next maintenance releases.