Apr 28, 2012, 7:40 AM
[CLOSED] Live Chart and JsonStore
Hi to all,
I'm trying to convert the live chart example in MVC. I created the controller, the view and it's working fine.
But when I try to add just a single data from the store it doesn't work as expected. I used the load method instead of reload but it still refresh the whole cache. I read the sencha documentation but no luck.
In the home controller I've the code to return a new point:
Any hint on how to ad just the last point
Thanks in advance
Mario
I'm trying to convert the live chart example in MVC. I created the controller, the view and it's working fine.
But when I try to add just a single data from the store it doesn't work as expected. I used the load method instead of reload but it still refresh the whole cache. I read the sencha documentation but no luck.
In the home controller I've the code to return a new point:
public JsonResult GetLiveData()
{
var random = new Random();
int floor=20;
var data = new ChartData
{
Name = DateTime.Now.ToString("hh:mm:ss"),
Data1 = Math.Floor(Math.Max(random.NextDouble() * 100, floor)),
Data2 = Math.Floor(Math.Max(random.NextDouble() * 100, floor)),
Data3 = Math.Floor(Math.Max(random.NextDouble() * 100, floor)),
};
return Json(data,JsonRequestBehavior.AllowGet);
}
In the view I left the example like the original (just changed the names of the fields) and in the taskmanager I wrote<ext:TaskManager ID="TaskManager1" runat="server">
<Tasks>
<ext:Task TaskID="DataTask" AutoRun="true" Interval="5000">
<Listeners>
<Update Handler="#{Store1}.load();" />
</Listeners>
</ext:Task>
</Tasks>
</ext:TaskManager>
The result, as expected, is that I get just one point to my series.Any hint on how to ad just the last point
Thanks in advance
Mario
Last edited by Daniil; Apr 30, 2012 at 10:01 AM.
Reason: Please use [CODE] tags, [CLOSED]