TeeChart for ActiveX, COM and ASP
-
Guilz
- Newbie

- Posts: 46
- Joined: Mon Nov 13, 2006 12:00 am
Post
by Guilz » Thu Oct 14, 2010 2:49 pm
Hi,
I use some Teechart function based on main serie (like Moving Average). I use the anti-aliasing tools to render.
But the result on moving average is not so good, the result is not a nice curve...How can I obtain a nice moving average curve ? I hope my sample is more clear than my words

- smooth.jpg (108.65 KiB) Viewed 7478 times
Thanks for your help,
Guilz
-
Narcís
- Site Admin

- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Oct 15, 2010 8:47 am
Hi Guilz,
You can add a smoothing function to your chart having the moving average series as source series and make it invisible.
Hope this helps.
-
Guilz
- Newbie

- Posts: 46
- Joined: Mon Nov 13, 2006 12:00 am
Post
by Guilz » Fri Oct 15, 2010 9:18 am
Hi Narcis,
I try what you suggest but the result is not fantastic (not a lot difference between smooth serie based on moving average serie and the moving average serie)
changing factor of smooth serie as not a big impact...

- smooth2.jpg (104.55 KiB) Viewed 7542 times
Guilz
-
Yeray
- Site Admin

- Posts: 9645
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Fri Oct 15, 2010 3:19 pm
Hi Guilz,
Take a look at the following example. There is a Point series (source), a moving average function and a smoothing function.
If you zoom in, you'll see how the smoothed function is smoother than the moving average function.
Code: Select all
Private Sub Form_Load()
TeeCommander1.ChartLink = TChart1.ChartLink
TChart1.Legend.Visible = False
TChart1.Aspect.View3D = False
TChart1.AddSeries scPoint
TChart1.Series(0).FillSampleValues 100
TChart1.Series(0).asPoint.Pointer.HorizontalSize = 2
TChart1.Series(0).asPoint.Pointer.VerticalSize = 2
TChart1.AddSeries scLine
TChart1.Series(1).SetFunction tfMovavg
TChart1.Series(1).DataSource = TChart1.Series(0)
TChart1.Series(1).FunctionType.Period = 5
'TChart1.Series(1).Active = False
TChart1.AddSeries scLine
TChart1.Series(2).asLine.LinePen.Width = 2
TChart1.Series(2).SetFunction tfSmoothing
TChart1.Series(2).DataSource = TChart1.Series(1)
TChart1.Series(2).FunctionType.Period = 5
End Sub
If you still have problems with it, please try to arrange a simple example project we can run as-is to reproduce the problem here.