Is there an option to get a highlow bar with smoothed low and smooth high curve automatically without adding more points??
Right now the dark red highlow it's not smooth at all (see example)
Cheers
Karsten
BCB5 & TChart 8.04 VCL
THighLow & Smoothing
Re: THighLow & Smoothing
Hello Karsten,
Sorry for the delay. I recommend three options for solve your problem:
Thanks,
Sorry for the delay. I recommend three options for solve your problem:
- - Using GDI+ canvas, you can find an example in Demo of TeeChartVCL, concretely in Canvas/GDI+Canvas.
- Using AntiAlias canvas, you find an example in Demo Canavas/AntiAlias
- Using Tool Anti-Alias. There is an example to Tools/AntiAlias Filter in Demo Project of TeeCharVCL
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: THighLow & Smoothing
Hi Karsten,
Another option could be using 2 TSmoothing functions, one for the High Line and one for the Low line. The Smoothing function, however, uses more points internally.
Here it is an example:
Another option could be using 2 TSmoothing functions, one for the High Line and one for the Low line. The Smoothing function, however, uses more points internally.
Here it is an example:
Code: Select all
uses Series, ErrorBar, TeeSpline, TeeSeriesBandTool;
procedure TForm1.FormCreate(Sender: TObject);
var HighLow: THighLowSeries;
Fast1, Fast2, dummy: TFastLineSeries;
Smooth1, Smooth2: TSmoothingFunction;
SeriesBand1: TSeriesBandTool;
begin
Chart1.View3D:=false;
Chart1.Legend.Visible:=false;
HighLow:=Chart1.AddSeries(THighLowSeries) as THighLowSeries;
HighLow.FillSampleValues();
HighLow.Brush.Style:=bsSolid;
Smooth1:=TSmoothingFunction.Create(self);
Smooth2:=TSmoothingFunction.Create(self);
Fast1:=Chart1.AddSeries(TFastLineSeries) as TFastLineSeries;
Fast2:=Chart1.AddSeries(TFastLineSeries) as TFastLineSeries;
dummy:=TFastLineSeries.Create(self);
Fast1.FunctionType:=Smooth1;
Fast2.FunctionType:=Smooth2;
Fast1.Color:=clBlack;
Fast2.Color:=clBlack;
dummy.XValues.Value:=HighLow.XValues.Value;
dummy.YValues.Value:=HighLow.LowValues.Value;
dummy.XValues.Count:=HighLow.XValues.Count;
dummy.YValues.Count:=HighLow.YValues.Count;
Fast1.DataSource:=HighLow;
Fast2.DataSource:=dummy;
HighLow.Active:=false;
SeriesBand1:=Chart1.Tools.Add(TSeriesBandTool) as TSeriesBandTool;
SeriesBand1.Series:=Fast1;
SeriesBand1.Series2:=Fast2;
SeriesBand1.Brush.BackColor:=HighLow.Color;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |