     
     private func resizeDiv() {
         let height = frame.size.height
-        let width = self.frame.size.width
+        let width = frame.size.width
         let divCss = "'height:\(height)px;width:\(width)px;'"
         let jsString = "resizeDiv(\(divCss))"
         callJsMethod(jsString)

        
    }
    
    private func callJsMethod(jsString: String) {
//        print(jsString)
        self.evaluateJavaScript(jsString, completionHandler: nil)
    }
    
    private func preDealWithParams(paramsJson: String) -> String {

    // MARK: - Delegate
    // MARK: UIWebViewDelegate
    public func webView(webView: WKWebView, didFinishNavigation navigation: WKNavigation!) {
        webView .evaluateJavaScript("document.readyState") { [weak self] (result, error) in
            guard let strongSelf = self else { return }
            guard let result = result as? String where result == "complete" else {
                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(0.05 * Double(NSEC_PER_SEC))), dispatch_get_main_queue(), {
                    strongSelf.loadEcharts()
                })
                return
            }
            
            strongSelf.loadFinsih = true
            guard let option = strongSelf.option else {
                printWarning("The option is nil")
                strongSelf.callJsMethod("initEchartView()")
                return;
            }
            
            strongSelf.resizeDiv()
            JsCache.removeAll() // 清空之前缓存的方法，避免出现重复的情况， 在调用 option.jsonString 会重新生成
            let optionJson = option.jsonString
            
            // 定义Js与Clousure之间的匹配关系
            // 必须要在option.jsonString调用过一次之后
            // 并且需要在调用loadEcharts之前，这样才能建立关系
            for function in JsCache.allJsStrings() {
                printInfo(function)
                strongSelf.callJsMethod(function)
            }
            
            strongSelf.callJsMethod("loadEcharts('\(strongSelf.preDealWithParams("\(optionJson)"))')")
        }
    }

    public func webView(webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: () -> Void) {
