echarts 적응 차트, 용기의 폭을 백분율로 제공되지만, 그래프에 도시 한 불완전 함께 수축

<div ID = "chartContainer"스타일 = "신장 : 100 %, 가로 100 %"> </ div>

도 chartContainer Echart가 100 %보다 폭 Echart도 제공 저장하는 데 사용되는 경우에는 융합 DIV 없다

 

 

 강제로 폭과 높이가 필요 픽셀을 설정

<div ID = "chartContainer"스타일 = "높이 450 픽셀, 폭 : 1030px;"> </ div>

 

 

 

echarts 소스 폭을 계산한다 :

Painter.prototype._getWidth = 함수 () {
var에 루트 this.root =;
var에 STL = root.currentStyle || document.defaultView.getComputedStyle (루트);
창 ((root.clientWidth ||으로 parseInt (stl.width 10)) -으로 parseInt (stl.paddingLeft 10) -으로 parseInt (stl.paddingRight 10))에서는 toFixed (0) - 0.;
};

그 이유는 echarts 때문에 번째 탭 디스플레이의 특성 폭을 계산 차트로이다 : 없음;으로 parseInt (stl.width가, 10)의) 폭 동안 clientWidth는 얻을 수 없다 :, 스위치 (100), 산출 된 100 % 폭 100 픽셀 차트

추천

출처www.cnblogs.com/nje19951205/p/12029739.html