CursorTool in vertically stacked multiple custom Y-axis
Posted: Thu Apr 15, 2010 4:15 am
I have a vertical stack of custom y-axes as shown in the sample code below. I need to get the cursor tool of the chart to showup on every series associated with separate custom y-axis. Currently, the cursor tool only showsup on the first series. Can you please suggest what i should do?
Code: Select all
Imports Steema.TeeChart
Public Class Form1
Private fs(128) As Steema.TeeChart.Styles.FastLine
Private myAxis(128) As Steema.TeeChart.Axis
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
'Chart object
Dim tchart1 As New Steema.TeeChart.TChart
tchart1.Aspect.View3D = False
tchart1.Dock = DockStyle.Fill
tchart1.Aspect.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
tchart1.Aspect.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit
'Now cursor tool
Dim cursorTool1 As New Steema.TeeChart.Tools.CursorTool(tchart1.Chart)
cursorTool1.FollowMouse = True
cursorTool1.FastCursor = True
cursorTool1.Pen.Style = System.Drawing.Drawing2D.DashStyle.Solid
cursorTool1.Style = Steema.TeeChart.Tools.CursorToolStyles.Vertical
cursorTool1.Pen.Color = Color.Orange
cursorTool1.Pen.Width = 1
'Now fast lines
For i As Integer = 0 To 9
'fastlines
fs(i) = New Steema.TeeChart.Styles.FastLine(tchart1.Chart)
fs(i).FillSampleValues(18000)
fs(i).DrawAllPoints = False
'axis
If i = 0 Then
myAxis(i) = tchart1.Chart.Axes.Left
myAxis(i).StartEndPositionUnits = Steema.TeeChart.PositionUnits.Percent
myAxis(i).StartPosition = 0
myAxis(i).EndPosition = 10
fs(i).VertAxis = Styles.VerticalAxis.Left
Else
myAxis(i) = New Steema.TeeChart.Axis(tchart1.Chart)
myAxis(i).StartEndPositionUnits = Steema.TeeChart.PositionUnits.Percent
tchart1.Axes.Custom.Add(myAxis(i))
myAxis(i).StartPosition = myAxis(i - 1).EndPosition + 1
myAxis(i).EndPosition = myAxis(i).StartPosition + 9
fs(i).CustomVertAxis = myAxis(i)
End If
Next
Dim myYAxis As New Steema.TeeChart.Axis
tchart1.Axes.Custom.Add(myYAxis)
myYAxis.Grid.Visible = False
myYAxis.MinimumOffset = 15
'fastline
Dim fs2 As New Steema.TeeChart.Styles.FastLine(tchart1.Chart)
fs2.FillSampleValues()
fs2.DrawAllPoints = False
fs2.CustomVertAxis = myYAxis
myYAxis.StartPosition = 0
myYAxis.EndPosition = 12
'myYAxis.RelativePosition = -10
myYAxis.StartEndPositionUnits = Steema.TeeChart.PositionUnits.Percent
myYAxis.OtherSide = True
Me.Controls.Add(tchart1)
End Sub
End Class