Smoothing lines at runtime

TeeChart for ActiveX, COM and ASP
Post Reply
psc
Newbie
Newbie
Posts: 16
Joined: Wed May 05, 2004 4:00 am

Smoothing lines at runtime

Post by psc » Wed Aug 09, 2006 11:28 am

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

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Aug 09, 2006 11:48 am

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)

psc
Newbie
Newbie
Posts: 16
Joined: Wed May 05, 2004 4:00 am

Post by psc » Wed Aug 09, 2006 11:52 am

Many thanks for that prompt reply, its fixed my problem.

Post Reply