Page 1 of 1

Smoothing lines at runtime

Posted: Wed Aug 09, 2006 11:28 am
by 9082339
I'd like to specify at runtime the smoothing of a set of points. If I place the tee chart component with no series into a form at design time the follwoing code does not work when it comes to smoothing. Run time error '-2147418113 (8000ffff)' Method 'Interpolate' of object 'ISmoothingFunction' failed.

Private Sub Form_Load()

With TChart1
.RemoveAllSeries

.Aspect.View3D = False
.AddSeries scLine
With .Series(0)
.Name = "line1"
.FillSampleValues 25
.asLine.Pointer.Visible = True
End With

.AddSeries scLine
With TChart1.Series(1)

.DataSource = "line1"
.FunctionType.asSmoothing.Interpolate = False
.FunctionType.asSmoothing.Factor = 4

End With
End With


End Sub


I don't want to specify anything at design time and want to do this all at runtime. Using TeeChart Pro v6.0.0.5

Thanks

Posted: Wed Aug 09, 2006 11:48 am
by Pep
Hi,

you should set the function type before to assign a factor :

Code: Select all

With TChart1.Series(1)
.SetFunction tfSmoothing
.DataSource = TChart1.Series(0)

Posted: Wed Aug 09, 2006 11:52 am
by 9082339
Many thanks for that prompt reply, its fixed my problem.