0

我正在使用 Web Dataviz 包中的 Kendo UI 折线图来生成 500+ 的图表。但是图的负载太懒了。生成图表大约需要 25 秒。

我使用类别轴的日期和带有 odata 数据源的系列的十进制值。

我可以优化图表的加载时间吗?

$("#chart").kendoChart({
                theme: $(document).data("kendoSkin") || "default",
                dataSource: {
                    type: "odata",
                    transport: {
                        read: crudServiceBaseUrl + "/Odata/TestODataService.svc/EGauges"
                    },                      
                    serverFiltering: true,
                    serverSorting: true,
                    sort: { field: "DateData", dir: "asc"},
                    filter: [                       
                        {field: "From", operator: "eq", value: 422 },//400+
                        { field: "Id", operator: "eq", value: parseInt(id) },
                        { field: "Intervalo", operator: "eq", value: 23 },
                        { field: "Tipo", operator: "eq", value: 'm' }
                    ],
                title: {
                    text: ""
                },
                legend: {                       
                    position: "bottom"
                },
                seriesDefaults: {
                    type: "area"
                },
                series: [{
                    field: "Value",
                    name: "Value"
                }],
                categoryAxis: {
                    field: "DateData",
                    labels: {
                        visible: false,
                        rotation: -90
                    }
                },
                axisDefaults: {
                    visible: true,
                    majorGridLines: { visible: false }
                },
                tooltip: {
                    visible: true                       
                }
            });

以下是 odata 服务返回数据的方式:

jQuery1704278529312834345_1357310335401({"d" : {
 "results": [
 {
     "__metadata": {
     "uri": "http://localhost/Prosol.Web/Odata/TestODataService.svc/EGauges(18)", 
     "type": "TestOpenErpInterfaz.Web.TestEntityDataSource_EGauge"
  },
 "EGaugeID": 18, 
 "From": 422, 
 "Id": 18, 
 "Tipo": "m", 
 "Intervalo": 23, 
 "DateData": "\/Date(1357310820000)\/", 
 "Value": "3.72", 
 "TotalKw": "0", 
 "TotalCosto": "0.00", 
 "TotalKwGen": "203.23999999999999999999999999", 
 "TotalCostoGen": "16.259199999999999999999999999", 
 "FechaDisplay": "Ene 4, 2013 14:47"
},........
], "__count": "421"
}
})
4

1 回答 1

0

最后我使用 FlotCharts,由于某种原因,KendoUI Chart 加载数据非常懒惰......我使用 Kendo Ui Datasource 从 Web 服务读取数据并加载到 FloatChart...

http://www.flotcharts.org/

这是简单、快速且免费的软件

于 2013-01-09T16:30:04.627 回答