下载了echarts-gl.min.js,复制网友的现成程序,在前面引用了 <script src="echarts.min.js"></script>和<script src="echarts-gl.min.js"></script>,为什么生成不了图片呢。是引用echarts-gl.min.js出了问题么?
配置项如下
var hours = [ '2014', '2015', '2016'
];
var days = [
'1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'
];
var data = [
[0, 0, 0.159
],
[0, 1, 0.16
],
[0, 2, 0.146
],
//[0, 3, 0.344],
//[0, 4, 0.333],
[1, 0, 0.138
],
[1, 1, 0.16
],
[1, 2,0.139
],
//[1, 3, 0.404],
//[1, 4, 0.37],
[2, 0, 0.163
],
[2, 1, 0.168
],
[2, 2, 0.15
],
//[2, 3, 0.628],
//[2, 4, 0.534],
[3, 0, 0.169
],
[3, 1, 0.18
],
[3, 2, 0.161
],
//[3, 3, 0.37],
//[3, 4, 0.472],
[4, 0, 0.168
],
[4, 1,0.177
],
[4, 2, 0.157
],
//[4, 3, 0.249],
//[4, 4, 0.154],
[5, 0, 0.166
],
[5, 1, 0.17
],
[5, 2, 0.155
],
// [5, 3, 0.344],
//[5, 4, 0.333],
[6, 0, 0.17
],
[6, 1, 0.176
],
[6, 2, 0.159
],
//[6, 3, 0.404],
//[6, 4, 0.37],
[7, 0, 0.179
],
[7, 1, 0.182
],
[7, 2,0.161
],
//[7, 3, 0.628],
//[7, 4, 0.534],
[8, 0, 0.173
],
[8, 1, 0.176
],
[8, 2, 0.165
],
//[8, 3, 0.37],
// [8, 4, 0.472],
[9, 0, 0.179
],
[9, 1, 0.182
],
[9, 2, 0.177
],
// [9, 3, 0.249],
// [9, 4, 0.154],
[10, 0, 0.167
],
[10, 1,0.169
],
[10, 2, 0.172
],
// [10, 3, 0.628],
// [10, 4, 0.534],
[11, 0, 0.174
],
[11, 1, 0.162
],
[11, 2, 0.169
]
// [11, 3, 0.37],
// [11, 4, 0.472]
];
option = {
tooltip: {},
visualMap: {
min: 0.13,
max: 0.25,
inRange: {
color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026', '#a50026']
}
},
xAxis3D: {
type: 'category',
data: hours
},
yAxis3D: {
type: 'category',
data: days
},
zAxis3D: {
type: 'value'
},
grid3D: {
boxWidth: 80,
boxDepth: 200,
viewControl: {
// projection: 'orthographic'
},
light: {
main: {
intensity: 1.2,
shadow: false
},
ambient: {
intensity: 0.3
}
}
},
series: [{
type: 'bar3D',
data: data.map(function(item) {
return {
value: [item[1], item[0], item[2]],
}
}),
shading: 'lambert',
label: {
textStyle: {
fontSize: 20,
borderWidth: 0.5
}
},
itemStyle: {
opacity: 0.84
},
emphasis: {
label: {
textStyle: {
fontSize: 40,
color: '#900'
}
},
itemStyle: {
color: '#900'
}
}
}]
}