highchart 时间显示格式异常invalid data,如何能显示正常格式:2015-08-17 12:00:00
//<![CDATA[
$(function (datetimeCom, growth) {
// Highcharts.Chart Begin
Highcharts.setOptions({
global: {
useUTC: false //当X轴类型为datetime日期时间型的,需要设置时区
}
});
//声明报表对象
var chart = new Highcharts.Chart({
chart: {
//将报表对象渲染到层上
renderTo: 'container', //图表放置的容器,DIV
defaultSeriesType: 'spline' //图表类型为曲线图,可取值有:line、spline、area、areaspline、bar、column等
}, //chart end
title: {
text: '汽油吸附脱硫装置2#S-ZORB曲线'
},
yAxis: {
title: {
text: '2#S-ZORB实时值'
}
},
xAxis: {
type: 'datetime',
title: { text: '时间'
},
//坐标间隔
labels:{ step:10,
formatter: function () {
return Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.value);
}
},
},
//鼠标放在某个点上时的提示信息
//dateFormat,numberFormat是highCharts的工具类
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
Highcharts.numberFormat(this.y, 4);
}
},
//设定报表对象的初始数据
series: [{
name: '2#S-ZORB实时值',
data: []
}]
});
//获取初始化数据
getInitialData();
//Highcharts.Chart end
后台数据库取值是DataTable
DataTable dt = GetData(sql);