nitzbar
09-04-2008, 10:44 AM
Am trying to get VBA to chart the output from another procedure.Am looking at a scatter chart with 2 series, column j values on the x axis and columns k and l values on the y axis.
Here is what i have got do far.
Sub AddChart()
Dim chtChart As Chart
ActiveSheet.ChartObjects.Delete
'Create a new chart.
Set chtChart = Charts.Add
Set chtChart = chtChart.Location(Where:=xlLocationAsObject, Name:="Trades")
With chtChart
.ChartType = xlXYScatter
'Set data source range.
.SetSourceData Source:=Sheets("Trades").Range("j1:l1000"), PlotBy:=xlColumns
.HasTitle = True
.ChartTitle.Text = "Point and Figure"
'The Parent property is used to set properties of the Chart.
With .Parent
.Top = Range("F9").Top
.Left = Range("F9").Left
.Name = "Point and Figure Chart"
End With
End With
End Sub
Also, I would like to customize the chart in the following ways.
1. Have custom markers (shape, color) and marker sizes for both series
2. Adjust range of both axes
3. Add axes names
4 Also, is it possible to have an open ended data range ? I am using values that are continuously streaming in , so might have more than 32000 values ( Doubtful, but would like to know)
Would really appreciate it if someone could help me out.
Thanks.
Here is what i have got do far.
Sub AddChart()
Dim chtChart As Chart
ActiveSheet.ChartObjects.Delete
'Create a new chart.
Set chtChart = Charts.Add
Set chtChart = chtChart.Location(Where:=xlLocationAsObject, Name:="Trades")
With chtChart
.ChartType = xlXYScatter
'Set data source range.
.SetSourceData Source:=Sheets("Trades").Range("j1:l1000"), PlotBy:=xlColumns
.HasTitle = True
.ChartTitle.Text = "Point and Figure"
'The Parent property is used to set properties of the Chart.
With .Parent
.Top = Range("F9").Top
.Left = Range("F9").Left
.Name = "Point and Figure Chart"
End With
End With
End Sub
Also, I would like to customize the chart in the following ways.
1. Have custom markers (shape, color) and marker sizes for both series
2. Adjust range of both axes
3. Add axes names
4 Also, is it possible to have an open ended data range ? I am using values that are continuously streaming in , so might have more than 32000 values ( Doubtful, but would like to know)
Would really appreciate it if someone could help me out.
Thanks.