TBoxSeries add last value
TBoxSeries add last value
How can I add the last observation to a Box Plot Chart?
Re: TBoxSeries add last value
Hello,
You could have a TPointSeries with a single value you update each time a new point is added to the TBoxSeries. Ie:
You could have a TPointSeries with a single value you update each time a new point is added to the TBoxSeries. Ie:
Code: Select all
uses TeeBoxPlot, Series;
var BoxPlot: TBoxSeries;
LastPoint: TPointSeries;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
BoxPlot:=Chart1.AddSeries(TBoxSeries) as TBoxSeries;
BoxPlot.FillSampleValues;
LastPoint:=Chart1.AddSeries(TPointSeries) as TPointSeries;
LastPoint.AddXY(0, BoxPlot.YValue[BoxPlot.Count-1]);
end;
procedure TForm1.Button1Click(Sender: TObject);
var newPoint: Double;
begin
newPoint:=BoxPlot.YValues.MinValue+random*BoxPlot.YValues.Range;
BoxPlot.Add(newPoint);
LastPoint.YValue[0]:=newPoint;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |