码迷,mamicode.com
首页 > Web开发 > 详细

js前台给echarts赋值

时间:2020-01-13 11:03:13      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:spl   chart   trigger   category   etop   otto   ros   赋值   pre   

技术图片

 

 

技术图片

 

 

 


//资金变化趋势
function initChart22(theme) {
// var data = JSON.parse(‘{data:‘+chartInfo[0].zjbhqs+‘}‘)
// data = data.data
var data = JSON.parse(chartInfo[0].zjbhqs)
var legends = []
var zjbhqs = []

for(var i = 0; i < data.length;i++) {
legends.push(data[i].year)
zjbhqs.push(data[i].zjbhqs)
}
var option = {
tooltip: {
trigger: ‘axis‘,
axisPointer: {
type: ‘cross‘,
crossStyle: {
color: ‘#999‘
}
}
},
grid: {
top: 30,
bottom: 30
},
xAxis: [
{
type: ‘category‘,
data: legends,
axisPointer: {
type: ‘shadow‘
},
splitLine: false
}
],
yAxis: [
{
type: ‘value‘,
name: ‘‘,
min: 0,
splitLine: false
}
],
series: [
{
name: ‘资金‘,
type: ‘bar‘,
data: zjbhqs,
barMaxWidth: 50,
barMinWidth: 10
}
]
};
chart8 = echarts.init(that.$(‘#chart2-2‘)[0], theme);
chart8.setOption(option);
}

js前台给echarts赋值

标签:spl   chart   trigger   category   etop   otto   ros   赋值   pre   

原文地址:https://www.cnblogs.com/myfighting/p/12185888.html

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