-1

I'm wanting to take my Tchart (connected to a database query through a clientdataset) and draw a best fit line onto it. To do this (unless there is a built in method) I'm planning to work out the gradient of the first and the last data entries. How do I grab their coordinates to calculate the gradient for the line equation? This is what i want in psuedocode:

FirstXAxis := Datapoint[0].XAxis; 
LastXAxis := Datapoint[LastEntry].XAxis; 

I know this isn't strictly a line of best fit but I couldn't think of anything else (I'm new to graphical delphi and databases). How do I find LastEntry?

Please help me out, Toby

4

1 回答 1

1

您可能对曲线拟合函数 ( TCurveFittingFunction ) 感兴趣。您可以在All Features\Welcome!\Functions\Extended\Curve中找到示例,这些示例位于由 Pro 二进制安装程序创建的 TeeChart 程序组提供的新功能演示中。还包括有关如何计算线梯度的示例。

于 2015-02-09T10:19:46.673 回答