Hello
i originally posted this in a VB.net forum but was told I might have succee in a VB6 forum. I am trying to create a scatter plot with 2 series of data but I am struggling to find out if MS Chart is capable of doing this? My code is below for performing one series.
Dim Graph(0 To 3, 0 To 1) As Double
Dim Graph2(0 To 1, 0 To 1) As Double
Dim z As Integer = 1
Graph(0, 0) = myCalibration.CalibAct(1)
Graph(1, 0) = myCalibration.CalibAct(2)
Graph(2, 0) = myCalibration.CalibAct(3)
Graph(3, 0) = myCalibration.CalibAct(4)
Graph(0, 1) = myCalibration.CalibRead(1)
Graph(1, 1) = myCalibration.CalibRead(2)
Graph(2, 1) = myCalibration.CalibRead(3)
Graph(3, 1) = myCalibration.CalibRead(4)
Graph2(0, 0) = 175
Graph2(1, 0) = 250
Graph2(0, 1) = 2
Graph2(1, 1) = 10
chtCalib.chartType = MSChart20Lib.VtChChartType.VtChChartType2dXY 'VtChChartType2dXY ' set to X Y Scatter chart
chtCalib.ChartData = Graph ' populate chart's data grid using Graph array
chtCalib.Plot.UniformAxis = False
'Add a title and legend.
With Me.chtCalib
.Title.Text = "Calibration Chart"
.Legend.Location.LocationType = _
MSChart20Lib.VtChLocationType.VtChLocationTypeBottom
.Legend.Location.Visible = True
End With
'Add titles to the axes.
With Me.chtCalib.Plot
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdX).AxisTitle.Text = "Volts"
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).AxisTitle.Text = "Distance (mm)"
End With
With Me.chtCalib.Plot
'Yellow for Company A
' -1 selects all the datapoints.
.SeriesCollection(1).DataPoints(-1).Brush.FillColor.Set(200, 50, 200)
End With
End Sub
Any Help would be appreciated. Thanks
William
i originally posted this in a VB.net forum but was told I might have succee in a VB6 forum. I am trying to create a scatter plot with 2 series of data but I am struggling to find out if MS Chart is capable of doing this? My code is below for performing one series.
Dim Graph(0 To 3, 0 To 1) As Double
Dim Graph2(0 To 1, 0 To 1) As Double
Dim z As Integer = 1
Graph(0, 0) = myCalibration.CalibAct(1)
Graph(1, 0) = myCalibration.CalibAct(2)
Graph(2, 0) = myCalibration.CalibAct(3)
Graph(3, 0) = myCalibration.CalibAct(4)
Graph(0, 1) = myCalibration.CalibRead(1)
Graph(1, 1) = myCalibration.CalibRead(2)
Graph(2, 1) = myCalibration.CalibRead(3)
Graph(3, 1) = myCalibration.CalibRead(4)
Graph2(0, 0) = 175
Graph2(1, 0) = 250
Graph2(0, 1) = 2
Graph2(1, 1) = 10
chtCalib.chartType = MSChart20Lib.VtChChartType.VtChChartType2dXY 'VtChChartType2dXY ' set to X Y Scatter chart
chtCalib.ChartData = Graph ' populate chart's data grid using Graph array
chtCalib.Plot.UniformAxis = False
'Add a title and legend.
With Me.chtCalib
.Title.Text = "Calibration Chart"
.Legend.Location.LocationType = _
MSChart20Lib.VtChLocationType.VtChLocationTypeBottom
.Legend.Location.Visible = True
End With
'Add titles to the axes.
With Me.chtCalib.Plot
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdX).AxisTitle.Text = "Volts"
.Axis(MSChart20Lib.VtChAxisId.VtChAxisIdY).AxisTitle.Text = "Distance (mm)"
End With
With Me.chtCalib.Plot
'Yellow for Company A
' -1 selects all the datapoints.
.SeriesCollection(1).DataPoints(-1).Brush.FillColor.Set(200, 50, 200)
End With
End Sub
Any Help would be appreciated. Thanks
William