Trend example
Posted: Thu Mar 06, 2014 7:55 pm
I just purchased Pro so I could use trends in my graph. I need to configure it in design mode-
Obviously this doesnt draw a trend line. I see the bar graph but that's all. Any help will be appreciated.
Code: Select all
procedure TfrmPsrGraph.SetupGraph(const v1,v2,v3:shortstring);
var
xBar3:TBarSeries;
xTrend:TTrendFunction;
m, b: Double;
begin
xTrend:=TTrendFunction.Create(self);
xBar3:=TBarSeries.Create(chtPSR);
xBar3.ParentChart:=chtPSR;
xBar3.SetFunction(xTrend);
xBar3.DataSource:=fPSRTable;
xBar3.CheckDataSource;
xTrend.CalculateTrend(m,b,xBar3,0,xBar3.Count);
xBar3.YValues.ValueSource:=v3;
xBar3.XValues.ValueSource:='psrdate';
xBar3.XValues.DateTime:=true;
xBar3.ShowInLegend:=false;
xBar3.Marks.Visible:=false;
xBar3.color:=clBlue;
xBar3.RefreshSeries;
xBar3.Title:='s3';
xBar3.ShowInLegend:=true;
chtPSR.BottomAxis.ExactDateTime:=true;
chtPSR.BottomAxis.DateTimeFormat:='m/d';
chtPSR.BottomAxis.Increment:= DateTimeStep[dtOneDay];
end;