|
@@ -402,6 +402,7 @@ export default {
|
|
|
let elesArr = Array.from(
|
|
let elesArr = Array.from(
|
|
|
new Set(this.myChart._chartsViews[0]._data._graphicEls)
|
|
new Set(this.myChart._chartsViews[0]._data._graphicEls)
|
|
|
);
|
|
);
|
|
|
|
|
+ console.log(elesArr.length)
|
|
|
let dep = this.myChart._chartsViews[0]._data.tree.root.height; //获取树高
|
|
let dep = this.myChart._chartsViews[0]._data.tree.root.height; //获取树高
|
|
|
console.log(dep);
|
|
console.log(dep);
|
|
|
let layer_height = 90; //层级之间的高度
|
|
let layer_height = 90; //层级之间的高度
|
|
@@ -413,19 +414,19 @@ export default {
|
|
|
let newWidth = Math.max(currentWidth, layer_width);
|
|
let newWidth = Math.max(currentWidth, layer_width);
|
|
|
console.log(newWidth);
|
|
console.log(newWidth);
|
|
|
if (newWidth < 200) {
|
|
if (newWidth < 200) {
|
|
|
- this.center[0] = '-70%';
|
|
|
|
|
|
|
+ this.center[0] = '-60%';
|
|
|
this.center[1] = (dep * 2) + '0%';
|
|
this.center[1] = (dep * 2) + '0%';
|
|
|
|
|
|
|
|
}else if (newWidth > 200 && newWidth < 500) {
|
|
}else if (newWidth > 200 && newWidth < 500) {
|
|
|
- this.center[0] = '-50%';
|
|
|
|
|
|
|
+ this.center[0] = '-56%';
|
|
|
this.center[1] = (dep * 1.5) + '0%';
|
|
this.center[1] = (dep * 1.5) + '0%';
|
|
|
|
|
|
|
|
}else if (newWidth > 500 && newWidth < 1000) {
|
|
}else if (newWidth > 500 && newWidth < 1000) {
|
|
|
- this.center[0] = '-10%';
|
|
|
|
|
|
|
+ this.center[0] = '-20%';
|
|
|
this.center[1] = (dep) + '0%';
|
|
this.center[1] = (dep) + '0%';
|
|
|
|
|
|
|
|
} else if (newWidth > 1000){
|
|
} else if (newWidth > 1000){
|
|
|
- this.center[0] = this.center[0] = elesArr.length > 60 ? newWidth * 1.2 : newWidth * 0.6;
|
|
|
|
|
|
|
+ this.center[0] = elesArr.length > 60 ? newWidth * 1.5 : newWidth * 1.2;
|
|
|
this.center[1] = (dep ) + '0%';
|
|
this.center[1] = (dep ) + '0%';
|
|
|
}
|
|
}
|
|
|
this.chartWidth = newWidth;
|
|
this.chartWidth = newWidth;
|