Skip to Content

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 27, 2017 at 05:10 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded