This example is essentially the same as this devShare post:<br />
<br />
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1548-creating-a-line-of-best-fit-line-in-a-scatter-chart/<br />
<br />
Except, it figures the line of best fit, when there is a date field on the x-axis, rather than an integer.<br />
<br />
This example shows how a "line of best fit" can be computed from the values in the scatter series. In the afterDataSetFilled, in the chart script, the average (x,y) point in the first half of the chart and the average (x,y) point in the second half of the chart are figured. These two points are then used to find the slope and y-intercept for the line of best fit. A second series is added to the chart, in the chart editor, called "Line of Best Fit", with a dummy value set at 0. Back in script, the line of best fit equation is used to compute and replace the points in the Line of Best Fit series.<br />
<br />
This report was created with BIRT 4.2.