You could also use a CEWP and do the same thing, but I would recommend creating a web part to handle your graphs.
You can create all the custom options you want in a web part without having to change code. If you use Excel Web Access Web Part to display the chart, it has an option to auto refresh at regular interval.
Can we automatically update the chart with the new months data and roll off the previous last month from the chart when we insert the new data?
Is there a way to create a chart/graph from a Sharepoint list, whether through Sharepoint graphing or MS Excel, so that the chart will automatically update when the data in the list changes?
Notice that the COUNT function gives us a total number of rows in our table, and we then specify how many rows we want to include in the [height] argument.
This is where you can change the number of months (for example) you want to include in your chart.
The Enterprise version of Share Point 2010 has a Chart Web Part under the Business Data category, and is a very simple OOTB solution for this.
It can connect to any list on your site and, while it won't automatically refresh if you're viewing it when someone else modifies an item in the connected list, it does generate the chart in realtime whenever you load the page.
I put a Chart and a view of the List together on a Web Part Page, so that editing an item in the list web part will cause the browser to reload the page, thus updating the chart image.
Creating reports on a regular schedule is a common task for the business Excel user.
When you need to create a Rolling chart that reflects data in a specific timeframe – such as the previous 12 months – you can quickly find yourself in a maintenance nightmare, updating your charts manually to include the new month’s data and exclude the now “out of date” data.