✸ ✸ ✸
折线效果图:
linedata数据格式:
{"data": [{"data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2749, 2151, 646, 2420, 217, 0, 0, 0, 0, 0, 0, 0, 0, 0], "name": "Apollo"}, {"data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 3152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "name": "GCLOUD"}], "result": true}
html+js代码:
<div class="chart" id="chartB"></div>
<script type="text/javascript">
var linedata=[];
var arr = new Array(32)
for (var i = 1; i < arr.length; i++) {
arr[i] = i;
}
$.ajax({
url: "/countalarm/",
type: 'GET',
dataType: 'json',
success: function (res) {
//获取数据成功
if (res.result) {
linedata = res.data;
$('#chartB').kendoChart({
legend: {
position: "bottom"
},
theme: 'bootstrap',
seriesDefaults: {
type: 'area',
area: {
line: {
style: "smooth"
}
}
},
categoryAxis: {
categories: arr,
majorGridLines: {
visible: false
}
},
series: linedata
});
} }
});
</script>
✸ ✸ ✸
📜 版权声明
本文作者:王梓 | 原文链接:https://www.bthlt.com/note/4985622-CssJsHtmlajax+echart折线图
出处:葫芦的运维日志 | 转载请注明出处并保留原文链接



📜 留言板
留言提交后需管理员审核通过才会显示