Using VB Express 2008
I am trying to refresh a SubChart using the following method, which worked in TeeChart 3.5:
Dim objects at class level:
Code: Select all
Dim SubTool As Steema.TeeChart.Tools.SubChartTool
Dim WithEvents SubChart As Steema.TeeChart.TChart
Code: Select all
If SubTool Is Nothing Then
SubTool = New Steema.TeeChart.Tools.SubChartTool(TChart1.Chart)
SubChart = SubTool.Charts.AddChart("ZoomChart")
SubChart.Left = 0
SubChart.Top = 0
SubChart.Width = TChart1.Width / 4
SubChart.Height = TChart1.Height / 4
SubChart.Header.Visible = False
SubChart.Aspect.View3D = False
SubChart.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels
SubChart.Panel.MarginLeft = 0
SubChart.Panel.MarginRight = 0
SubChart.Panel.MarginTop = 0
SubChart.Panel.MarginBottom = 0
SubChart.Axes.Bottom.Labels.Visible = False
SubChart.Axes.Left.Labels.Visible = False
Line1 = New Steema.TeeChart.Styles.Line(SubChart.Chart)
Line1.DataSource = FlowTable 'set data source for this series
Line1.Title = FlowTable.Columns(1).ColumnName 'set series title
Line1.YValues.DataMember = FlowTable.Columns(1).ColumnName 'which column of table has the Y values
Line1.XValues.DataMember = FlowTable.Columns(0).ColumnName 'which column of table has the X values
Line1.XValues.DateTime = True 'x values are date and time values
Line1.Brush.Transparency = 0 'not transparent
Line1.Color = Color.Green
Line1 = New Steema.TeeChart.Styles.Line(SubChart.Chart)
Line1.DataSource = FlowTable 'set data source for this series
Line1.Title = FlowTable.Columns(2).ColumnName 'set series title
Line1.YValues.DataMember = FlowTable.Columns(2).ColumnName 'which column of table has the Y values
Line1.XValues.DataMember = FlowTable.Columns(0).ColumnName 'which column of table has the X values
Line1.XValues.DateTime = True 'x values are date and time values
Line1.Brush.Transparency = 0 'not transparent
Line1.Color = Color.Red
End If
Code: Select all
SubChart.Refresh()
Code: Select all
SubChart.Axes.Bottom.Automatic = False
SubChart.Axes.Bottom.Minimum = Math.Floor(NPTool.Series.XValues(NPTool.Point))
SubChart.Axes.Bottom.Maximum = Math.Floor(NPTool.Series.XValues(NPTool.Point)) + 1
Jay