用echarts的timeline做一个动图,可是保存后动图出不来,哪位大佬帮看看!急急急 !!!!
码狗一枚 2018-11-06 02:23:45 js文件:
// 用电量echarts初始化
var elec = document.querySelector('#electric');
var elecChart = echarts.init(elec);
var elecOption = {
//timeline基本配置都写在baseoption 中
baseOption: {
timeline: {
//loop: false,
axisType: 'category',
autoPlay: true,
playInterval: 1000,
data: ['1', '2', '3']
},
grid: { containLabel: true },
xAxis: [{
type: 'category',
name: '企业',
data: ['1月','2月','3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
axisLine: {
lineStyle: {
color: '#83b4ce' //坐标轴线颜色
}
},
}],
yAxis: [{
type: 'value',
name: 'kwh',
axisLine: {
lineStyle: {
color: '#83b4ce' //坐标轴线颜色
}
},
}],
series: [{
type: 'bar',
//data: ['11','2','3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
}],
tooltip: {}
},
//变量则写在options中
options:[
{
series: [{
data: ['11','2','3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
}]
},
{
series: [{
data: ['11','2','3', '4', '5', '6', '7', '8', '9', '16', '11', '12']
}]
},
{
series: [{
data: ['11','2','3', '4', '5', '67', '7', '8', '9', '10', '11', '12']
}]
}
]
};
elecChart.setOption(elecOption);