博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
angulajs中引用chart.js做报表,修改线条样式
阅读量:6632 次
发布时间:2019-06-25

本文共 1823 字,大约阅读时间需要 6 分钟。

目前还有个问题,在手机上看,当折线y轴值超过1000,会有点问题

 

1.下载chart js,可以用bower 命令下载

 

2.html页面代码

View Code

 

3.Js数据组装(核心有个地方可以改线的样式,便于大家参考)

var funleaderbarDrawByLeader=function(pData)    {        $scope.overTimeLeaders=pData;         //折线         $scope.linecolours =[         {         label: "My First dataset",         fillColor: "rgba(70,191,189,0.2)",         strokeColor: "rgba(70,191,189,1)",         pointColor: "rgba(70,191,189,1)",         pointStrokeColor: "#fff",         pointHighlightFill: "#fff",         pointHighlightStroke: "rgba(70,191,189,1)"         },         {         label: "My Second dataset",         fillColor: "rgba(253,180,92,0.2)",         strokeColor: "rgba(253,180,92,1)",         pointColor: "rgba(253,180,92,1)",         pointStrokeColor: "#fff",         pointHighlightFill: "#fff",         pointHighlightStroke: "rgba(253,180,92,1)"         },             {                 label: "My Second dataset",                 fillColor: "rgba(128,206,69,0.2)",                 strokeColor: "rgba(128,206,69,1)",                 pointColor: "rgba(128,206,69,1)",                 pointStrokeColor: "#fff",                 pointHighlightFill: "#fff",                 pointHighlightStroke: "rgba(128,206,69,1)"             }         ];         $scope.labels = [];         $scope.series=[];         $scope.data = [];         $scope.lineDeptName="";//总加班工时提示         //{"OvertimeDate":"2014-10-01--2014-12-31","DeptID":"100145","DeptName":"信用卡室","LineID":"990283",         // "LineName":"数据中心","OvertimeHours":"1517.1000000000001","AvgHoursByDept":"1471.01","AvgHoursByEmp":"114.33"}         var lineDeptNameValue=0;         var OvertimeHoursData = [];         var AvgHoursData = [];         var AvgHoursByEmpData = [];         for(var i= 0;i
View Code

转载于:https://www.cnblogs.com/Zive/p/4253483.html

你可能感兴趣的文章