To make myself more clear, say, in the following code, I get 10 fast line series arranged vertically, say fs0 to fs9 series. Now, user drags and drops a csv file on the chart area covered by series fs6. I want to display the data such that both fs6 and new data shares the same vertical bounds (axis start and end positions of fs6) with same or new custom axis.
Can you please suggest?
Thanks,
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