function issues
Posted: Sun Apr 13, 2008 2:55 pm
Hi:
I'm working with functions. I've implemented many of them, but some work and some do not. My basic subroutine to enable a function is:
Private Sub SetUnSetFunction(Mnu As Menu, SeriesType As Long, Label As String)
With TChart1(TChartIndex)
Do While .SeriesCount > 1
.RemoveSeries .SeriesCount - 1
Loop
If Mnu Is FunctionMenu Then
Set FunctionMenu = Nothing
Exit Sub
End If
Set FunctionMenu = Mnu
Mnu.Checked = True
SeriesNum = 1
.AddSeries scLine
.Series(SeriesNum).SetFunction SeriesType
.Series(SeriesNum).Title = Label
.Series(SeriesNum).DataSource = .Series(0).Name
.Series(SeriesNum).CheckDataSource
End With
end sub
And it it's called as:
SetUnSetFunction MnuAverage, tfAverage, "Average"
The functions that work are:
Average
Exp Trend
Median
Perimeter
RMS
Smoothing
Std. Dev.
Trend
The functions that don't work are:
Correlation
Mode
Momentum division
Performance
Variance
For the functions that don't work, in general the new function series is all 0, but sometimes adding the function series forces both series' to 0.
Am I doing something wrong?
Thanks,
Matt
I'm working with functions. I've implemented many of them, but some work and some do not. My basic subroutine to enable a function is:
Private Sub SetUnSetFunction(Mnu As Menu, SeriesType As Long, Label As String)
With TChart1(TChartIndex)
Do While .SeriesCount > 1
.RemoveSeries .SeriesCount - 1
Loop
If Mnu Is FunctionMenu Then
Set FunctionMenu = Nothing
Exit Sub
End If
Set FunctionMenu = Mnu
Mnu.Checked = True
SeriesNum = 1
.AddSeries scLine
.Series(SeriesNum).SetFunction SeriesType
.Series(SeriesNum).Title = Label
.Series(SeriesNum).DataSource = .Series(0).Name
.Series(SeriesNum).CheckDataSource
End With
end sub
And it it's called as:
SetUnSetFunction MnuAverage, tfAverage, "Average"
The functions that work are:
Average
Exp Trend
Median
Perimeter
RMS
Smoothing
Std. Dev.
Trend
The functions that don't work are:
Correlation
Mode
Momentum division
Performance
Variance
For the functions that don't work, in general the new function series is all 0, but sometimes adding the function series forces both series' to 0.
Am I doing something wrong?
Thanks,
Matt