Skip to Content
0

can any 1 please share the same idea on oData service??

Feb 25, 2017 at 09:27 PM

52

avatar image

I wanted a viz chart of dual line which will fetch the value from oData every 5 seconds and only line of the graph has to extend(append).
Thanks in advance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Srikanth KV Feb 27, 2017 at 05:10 PM
0

Use JS timing events(setInterval method) to set binding of the chart every 5 seconds.

Use below code in the controller init method:

var oChart = this.getView().byId("myChart");

setInterval(function(){
    
    oChart.getDataset().bindAggregation("data", {
        path: <path to your oData service>,
        filters: [], //apply any filters here
        sorter: []
   });
}, 5000); //5000 milliseconds

Note: Since ODATA is called every 5 seconds this will have huge performance impact in terms of data retrieval and rendering of chart

Are you building a stock market kind of application?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Srikanth.
I am building an application in which temp and pressure are displayed in charts and the data will be getting saved in odata from the sensors

0