码迷,mamicode.com
首页 > 其他好文 > 详细

图表------折线图

时间:2019-02-16 15:44:23      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:--   chart   object   xpath   $.ajax   typeof   sensor   ecs   box   

@layout("/common/_container.html"){
<div class="ibox float-e-margins">
<div class="ibox-content">
<h3 style="text-align:center;color:red;" id="ts"></h3>
<div class="form-horizontal" id="temperatureCabinetInfoForm" >
<div id="container" style="height:450px">
</div>
</div>
</div>
</div>
<script src="${ctxPath}/static/modular/well/temperatureCabinet/temperatureCabinet_info.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=ZUONbpqGBsYGXNIYHicvbAbM"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/simplex.js"></script>
<script type="text/javascript">
var aa = "${id}";
//debugger;
// console.log(aa);
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
//var app = {};
option = null;
$.ajax({
url:Feng.ctxPath + "/temperatureSensor/zhexian",
type:"post",
data: {cabinet:aa},//井盖人员
dataType:"json",
success:function(data){
/* var legend[] =data.list;
var xAxis[] =data.listm; */
var legends = [];
legends=data.list;
// alert(legends.length);
if(legends.length>0){

}else{
$("#ts").html("暂无数据")
}
option = {
tooltip: {
trigger: ‘axis‘
},
legend: {
data:data.list
},
grid: {
left: ‘3%‘,
right: ‘10%‘,
bottom: ‘3%‘,
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
name : ‘日期‘,
type: ‘category‘,
boundaryGap: false,
data: data.listm
},
yAxis: {
name : ‘温度(℃)‘,
type: ‘value‘
},
series:data.listp /* [
{
name:‘上A‘,
type:‘line‘,
//stack: ‘总量‘,
data:[100.2,52,100,42.1]
},
{
name:‘上A‘,
type:‘line‘,
//stack: ‘总量‘,
data:[100,50]
},
{
name:‘上C‘,
type:‘line‘,
//stack: ‘总量‘,
data:[10,20,10,]
},
{
name:‘下B‘,
type:‘line‘,
//stack: ‘总量‘,
data:[100,52,10,42,76]
},
{
name:‘下C‘,
type:‘line‘,
//stack: ‘总量‘,
data:[20,20,10,402,96,38]
}
] */
}
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
}
})

 

</script>
@}

图表------折线图

标签:--   chart   object   xpath   $.ajax   typeof   sensor   ecs   box   

原文地址:https://www.cnblogs.com/cxiang/p/10387597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!