|
@@ -76,17 +76,19 @@ export function insertLuckysheetEChart({
|
|
|
let S = r.init(document.getElementsByClassName(u)[0]);
|
|
|
f.animation = false;
|
|
|
// 图例为空时,从数据组series中获取名称
|
|
|
- if (!f.legend.data || f.legend.data.length == 0 || !f.legend.data[0]) {
|
|
|
+ if (f.legend && (!f.legend.data || f.legend.data.length == 0 || !f.legend.data[0])) {
|
|
|
let arr = []
|
|
|
for (let nn = 0; nn < f.series.length; nn++) {
|
|
|
arr.push(f.series[nn].name)
|
|
|
}
|
|
|
f.legend.data = arr
|
|
|
}
|
|
|
- // 动态获取图例所占高度
|
|
|
- const height = getLegendHeight(j, f.legend.data)
|
|
|
- console.log(height)
|
|
|
- f.grid.bottom = height + 80
|
|
|
+ if (f.legend) {
|
|
|
+ // 动态获取图例所占高度
|
|
|
+ const height = getLegendHeight(j, f.legend.data)
|
|
|
+ console.log(height)
|
|
|
+ f.grid.bottom = height + 80
|
|
|
+ }
|
|
|
S.on('finished', function() {
|
|
|
// const imgBase = n(`.${u} canvas`)[0].toDataURL('image/png');
|
|
|
// console.log(imgBase);
|