我在下面的Stackoverflow问题中遵循了解决方案。但我想在xaxis上绘制时间。但它不起作用
http://jsfiddle.net/ksdqhqb2/38/
请检查下面的小提琴。我没有得到图表输出。
var App = angular.module('App', []);
App.controller('Ctrl', function ($scope) {
$scope.data = [
[1438031893270, 1],
[1438031894270, 2],
[1438031895269, 3],
[1438031896269, 4],
[1438031897278, 5],
[1438031898270, 6],
[1438031899268, 7],
[1438031900277, 8],
[1438031901269, 9]
];
});
App.directive('chart', function () {
return {
restrict: 'E',
link: function (scope, elem, attrs) {
var opts = {
xaxis: {
mode: "time",
timeformat: "%H:%M:%S"
},
};
var data = scope[attrs.ngModel];
$.plot(elem, data, opts);
elem.show();
}
};
});
http://jsfiddle.net/ksdqhqb2/39/
{{3}}