Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在angularjs中显示包含大量数据的highcharts图形_Angularjs_Highcharts_Highcharts Ng - Fatal编程技术网

在angularjs中显示包含大量数据的highcharts图形

在angularjs中显示包含大量数据的highcharts图形,angularjs,highcharts,highcharts-ng,Angularjs,Highcharts,Highcharts Ng,我有一个angularjs应用程序,用来显示一些图形。我从http请求中获取数据,并修改数据以在图形中显示它们。 如果我只收到一些数据,这是正常的,但当我收到很多数据时,highcharts组件需要很长时间来显示数据。在这段时间里,浏览器冻结了 在我的控制器中,我有: widgetCtrl.chartDataLine = { chart: { type: 'spline', zoomType: 'xy' }, title: {

我有一个angularjs应用程序,用来显示一些图形。我从http请求中获取数据,并修改数据以在图形中显示它们。 如果我只收到一些数据,这是正常的,但当我收到很多数据时,highcharts组件需要很长时间来显示数据。在这段时间里,浏览器冻结了

在我的控制器中,我有:

widgetCtrl.chartDataLine = {
    chart: {
        type: 'spline',
        zoomType: 'xy'
    },
    title: {
        text: 'Power Consumption'
    },
    xAxis: {
        type: 'datetime',
        title: {
            text: 'Date time'
        }
    },
    yAxis: {
        title: {
            text: 'Power (W)'
        },
        min: 0
    },
    options: {
        exporting: {
            enabled: true,
            allowHTML: true,
            buttons: {
                contextButton: {
                    menuItems: null,
                    onclick: function () {
                        this.exportChart();
                    }
                }
            }
        }
    },

    plotOptions:{
        series:{
            turboThreshold:60000 // larger threshold or set to 0 to disable
        }
    },

    series: []
};
我这样称呼这些数据:

var getMetrics = function (searchText) {
    var param = {
        target: searchText
    };
    xcsDatasource.get('beo').callAction('getPowerMetrics', param.target, widgetCtrl.pickerFrom.date, widgetCtrl.pickerTo.date).then(
        function (result) {
            widgetCtrl.metrics = result;
            widgetCtrl.metricsAsString = JSON.stringify(result);
            var t = getChartData(result);


            widgetCtrl.chartDataLine.series = angular.copy(t);
            console.log(widgetCtrl.chartDataLine);
            //widgetCtrl.chartDataArea.series = getChartData(result);

        },
        function () {
            widgetCtrl.metrics = {};
            widgetCtrl.metricsAsString = '';
        }
    );
};
这是我的html:

<div ng-if="config.linechart" class="graph-container col-sm-12">
    <highchart id="chart1" config="pwrDashboardViewCtrl.chartDataLine"></highchart>
</div>


你知道我如何在不冻结浏览器的情况下继续加载Graph吗?

你考虑过使用boost模块吗()?我添加了boost,但我看不出有什么区别…你能提供一个再现问题的最小的实时演示吗(理想情况下是JSFIDLE)?