cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

how to use time Series Chart?

SOLVED

Re: how to use time Series Chart?

Thank for replay

 

I Tested.

 

setInterval(function() {
         $scope.ProcessRandomData();
}, 1000 );
 
$scope.ProcessRandomData = function()
{
    console.log("update");

    // This code is necessary for it to work.
    $scope.$apply(()=> { 
        $scope.setWidgetProp('timeSeriesChart','data',{});
    });

    for(var i = 0 ; i < data.length ; i++ )
    {
        RandValue = parseIntMath.random()*1600);

        if(data[i].SENSOR10 != null)
            data[i].SENSOR10 = Number(RandValue);
        data[i].timestamp=moment(data[i].timestamp)
    }
 
    // refresh data
    $scope.$apply(()=> { 
        $scope.setWidgetProp('timeSeriesChart','data',data);
    });

    $scope.$applyAsync($timeout(function() { 
        $scope.$root.$broadcast('app.view["Home"].wdg["timeSeriesChart"].svc.updateChart')
      },150));
}
 
Announcements
Topics available:
AR/VR for Data Optimization AR/VR for Security and Control AR/VR for Inspection