Hello,
This is my first time post here
License: TeeChart VCL Std with source...
I am creating the Current.jpg bargraphs programmatically in Delphi Rio and display them in Fast-Report VCL. I haven't found a way to stack two bars on the same X position like in Goal.jpg screenshot..
Is this possible using my version of TeeChart? If yes, can I also smooth my red Current.jpg curve graph so it looks more like the blue one in Goal.jpg..?
Thanks a lot for help or comments on this.
best regards Tor
Stack two bars on top of each other....
Stack two bars on top of each other....
- Attachments
-
- Goal.jpg (27.93 KiB) Viewed 7533 times
-
- Current.jpg (141.81 KiB) Viewed 7533 times
Re: Stack two bars on top of each other....
Hello,
Here a simple example:
You basically need to set the
Here a simple example:
You basically need to set the
TBarSeries
MultiBar
property mbStacked
and use an additional TLineSeries
with a TSmoothingFunction
to show a smoothed line while still showing only a few (source) points:Code: Select all
uses Series, TeeSpLine;
procedure TForm1.FormCreate(Sender: TObject);
var i,j: Integer;
SourceSeries: TPointSeries;
SmoothSeries: TLineSeries;
SmoothFun: TSmoothingFunction;
begin
Chart1.View3D:=False;
Chart1.Gradient.Visible:=False;
Chart1.Color:=clWhite;
Chart1.Walls.Back.Gradient.Visible:=False;
Chart1.Walls.Back.Color:=clWhite;
Chart1.Legend.Hide;
Chart1.Axes.Bottom.Grid.Hide;
Chart1.Axes.Left.Grid.Hide;
for i:=0 to 1 do
with TBarSeries(Chart1.AddSeries(TBarSeries)) do
begin
FillSampleValues(12);
MultiBar:=mbStacked;
Marks.Hide;
if i=0 then
begin
for j:=0 to Count-1 do
YValue[j]:=-YValue[j];
end;
end;
SourceSeries:=TPointSeries.Create(Chart1);
with SourceSeries do
begin
FillSampleValues(12);
Pointer.Show;
Pointer.Color:=clWhite;
Pointer.Style:=psCircle;
end;
SmoothSeries:=TLineSeries(Chart1.AddSeries(TLineSeries));
with SmoothSeries do
begin
ShowInEditor:=False;
ShowInLegend:=False;
SmoothFun:=TSmoothingFunction.Create(Chart1);
SmoothFun.Interpolate:=True;
SmoothFun.Factor:=8;
SetFunction(SmoothFun);
DataSource:=SourceSeries;
end;
Chart1.AddSeries(SourceSeries);
SmoothSeries.Color:=SourceSeries.Color;
SourceSeries.Pointer.Pen.Color:=SmoothSeries.Color;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |