With the TAverageFunction is there is a way to draw the average like it

I can draw the average but this is not cutted between the barSeries.
Thank you for help
Regards
Narcís Calvet / 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 |
Narcís Calvet / 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 |
In that case we recommend you to manually calculate average and custom draw it on chart's canvas. You can also use existing average series, disable it and use its value for manually plotting the lines you want. You'll find more information about custom drawing in Tutorial 13 - Custom drawing on the Chart Panel. Tutorials are available at TeeChart's program group. On this forum, using its search feature, you will also find several custom drawing examples.How i can do to have the testseries width = the group bar width and center it on each group bar?
Yes, in that case you have two options:If i unchecked series the scale is changed. Is it possible to prevent it?
Narcís Calvet / 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 |
Code: Select all
Series1.AddXY(0,50);
Series1.AddXY(1,60);
Series1.AddXY(2,40);
Series2.AddXY(0,40);
Series2.AddXY(1,30);
Series2.AddXY(2,70);
Series3.AddNull(0);
Series3.AddXY(1,70);
Series3.Addnull(2);
Chart1.Draw();
delta_x:=Abs(Series1.XScreenToValue(Series2.CalcXPos(0))-Series1.XScreenToValue(Series1.CalcXPos(0)));
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(0));
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_deb,50);
Series4.AddXY(x_fin,50);
Series4.AddNullXY(x_fin,50);
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(1));
Series4.AddXY(x_deb,60);
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_fin,60);
Series4.AddNullXY(x_fin,60);
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(2));
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_deb,60);
Series4.AddXY(x_fin,60);
When I mentioned that you could set series values to null an option to do this is setting bar's color to clNone, for example:On the other hand using custom axis means that on one axis i have all the bar for one project in my case. If i uncheck it in legend, all the bars of one project are hidden. But i don't want it. I have to hidde the bar 1 on project 1, the bar 1 one project 2...
Code: Select all
Series1.Color:=clNone;
Code: Select all
for i:=0 to Chart1.SeriesCount - 2 do
begin
Chart1[i].ValueColor[0]:=clNone;
end;
In that case you should set bar series like this:Futhermore i have not find a solution in custom axis to draw the bar side by side.
Code: Select all
Series1.SideMargins:=false;
Series1.BarWidthPercent:=100;
Draw method call in the code you posted should prevent this. This code works fine for me here:By using this method if i do
Series1.AddXY(0,50);
Series2.AddXY(0,40);
Series3.AddNull(0);
the first time, x_deb, delta_x and x_fin equal 0
How could prevent it?
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var delta_x : Double;
x_deb : Double;
x_fin : Double;
i : Integer;
begin
Series1.AddXY(0,50);
Series1.AddXY(1,60);
Series1.AddXY(2,40);
Series2.AddXY(0,40);
Series2.AddXY(1,30);
Series2.AddXY(2,70);
Series3.AddNull(0);
Series3.AddXY(1,70);
Series3.Addnull(2);
Chart1.Draw;
delta_x:=Abs(Series1.XScreenToValue(Series2.CalcXPos(0))-Series1.XScreenToValue(Series1.CalcXPos(0)));
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(0));
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_deb,50);
Series4.AddXY(x_fin,50);
Series4.AddNullXY(x_fin,50);
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(1));
Series4.AddXY(x_deb,60);
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_fin,60);
Series4.AddNullXY(x_fin,60);
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(2));
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_deb,60);
Series4.AddXY(x_fin,60);
end;
Narcís Calvet / 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 |
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
delta_x,x_deb,x_fin:double;
begin
Chart1.LeftAxis.Automatic:=FALSE;
Chart1.LeftAxis.Minimum:=0;
Chart1.LeftAxis.Maximum:=100;
Chart1.LeftAxis.Increment:=20;
Series1.AddXY(0,50,'P1');
Series2.AddXY(0,40,'P1');
Series3.AddNull(0);
Chart1.Draw();
delta_x:=Abs(Series1.XScreenToValue(Series2.CalcXPos(0))-Series1.XScreenToValue(Series1.CalcXPos(0)));
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(0));
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_deb,60);
Series4.AddXY(x_fin,60);
Series4.AddNullXY(x_fin,50);
end;
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
delta_x,x_deb,x_fin:double;
begin
Chart1.Axes.Left.Automatic:=FALSE;
Chart1.Axes.Left.SetMinMax(0,100);
Chart1.Axes.Left.Increment:=20;
Series1.AddXY(0,50,'P1');
Series2.AddXY(0,40,'P1');
Series3.AddNull(0);
if Series1.Count=1 then
begin
Series1.AddNull('');
Series2.AddNull('');
Series3.AddNull('');
Chart1.Axes.Bottom.SetMinMax(Series1.MinXValue-0.5,Series1.XValue[Series1.Count-2]+0.5);
//or
//Chart1.Axes.Bottom.SetMinMax(-0.5,0.5);
end;
Chart1.Draw;
delta_x:=Abs(Series1.XScreenToValue(Series2.CalcXPos(0))-Series1.XScreenToValue(Series1.CalcXPos(0)));
x_deb:=Series1.XScreenToValue(Series1.CalcXPos(0));
x_fin:=x_deb+delta_x*3;
Series4.AddXY(x_deb,60);
Series4.AddXY(x_fin,60);
Series4.AddNullXY(x_fin,50);
end;
Narcís Calvet / 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 |