How to graph linear regression

Hello,

I need to chart energy values and forecast trend by calculating a linear regression. And put it in a report.
Is there a way to do it in the report module ? if not, I can calculate it and store it in SQL; but how to show up in a scatter plot and plot a line for the regression ?

Anyone has yet use the sdk to use a java chart library ?

Many thanks.

All of your data for the report is going into a dataset, so you could use python to take the raw data and mangle it into your final dataset. Just use a SQL query on one dataset and on a propertyChange event write a python script to copy it, do your linear regression calculation, and add the projected data. Store it in a final dataset on the report and use that in your charts. I haven’t used the sdk to do this, but it’s pretty easy to do so the hardest part should be your calculation.