64 lines
2.1 KiB
JavaScript
64 lines
2.1 KiB
JavaScript
app.controller("QualifiedCtrl", ["$scope","$http", function ($scope,$http) {
|
|
$scope.titlestr = "合格率分析";
|
|
$scope.legend = ["合格率"];
|
|
$scope.item = ['2008','2009','2010','2011','2012','2013','2014','2015','2016','2017','2018'];
|
|
$scope.data = [
|
|
[1,1,1,1,1,1,1,1,1,1,1]
|
|
];
|
|
|
|
//增加日志20211109
|
|
addlog("合格率", "查询[合格率]")
|
|
|
|
$http.post('/home/',
|
|
{ "xflobj": $scope.MyXiaoFeiLiangData, "ypobj": $scope.MyYangPinData, "JCXM": $scope.DuiBiJianChaXiangMu }
|
|
).success(function (mydata) {
|
|
mydata.jianyanxiagngmu = $scope.DuiBiJianChaXiangMu;
|
|
$scope.JianYanJieGuoJi.push(mydata);
|
|
})
|
|
|
|
|
|
}])
|
|
app.directive('hegelvline', function() {
|
|
return {
|
|
restrict: 'E',
|
|
template: '<div style="height:400px;width:800px;"></div>',
|
|
replace: true,
|
|
link: function($scope, element, attrs, controller) {
|
|
var option = {
|
|
// 提示框,鼠标悬浮交互时的信息提示
|
|
tooltip: {
|
|
show: true,
|
|
trigger: 'item'
|
|
},
|
|
// 图例
|
|
legend: {
|
|
data: $scope.legend
|
|
},
|
|
// 横轴坐标轴
|
|
xAxis: [{
|
|
type: 'category',
|
|
data: $scope.item
|
|
}],
|
|
// 纵轴坐标轴
|
|
yAxis: [{
|
|
type: 'value'
|
|
}],
|
|
// 数据内容数组
|
|
series: function () {
|
|
var serie = [];
|
|
for (var i = 0; i < $scope.legend.length; i++) {
|
|
var item = {
|
|
name: $scope.legend[i],
|
|
type: 'line',
|
|
data: $scope.data[i]
|
|
};
|
|
serie.push(item);
|
|
}
|
|
return serie;
|
|
}()
|
|
};
|
|
var myChart = echarts.init(document.getElementById("main"));
|
|
myChart.setOption(option);
|
|
}
|
|
};
|
|
}); |