Hi, I'm writing some code that will synchronize data in database with chart (it's zedgraph in fact - but it doesn't matter). I want to do something like this:
- chart draws data from databse
- whenever new data is added to DB, it's immediately drawn on the chart
So far everything works ok, because I can bind chart line DataSource to a data table. But I also want to draw a moving average of the values on the chart. So I used Table Adapter to write a query that calculates the moving average and returns the result. Then I created a new chart line and bind it to the result of a query:
it = new DatabaseDataSetTableAdapters.IntradayAdapter();
line.DataSource = it.GetSMABy(name);
Is it possible that whenever new data is Added to DB it gets drawn on the chart and recalculates the moving average without any action listeners?