src/Painter.js
function (opts) {
        opts = opts || {};
        if (this._singleCanvas && !this._compositeManually) {
            return this._layers[CANVAS_ZLEVEL].dom;
        }

        var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);
        imageLayer.initContext();
        imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);

        if (opts.pixelRatio <= this.dpr) {
            this.refresh();

            var width = imageLayer.dom.width;
            var height = imageLayer.dom.height;
            var ctx = imageLayer.ctx;
            this.eachLayer(function (layer) {
                if (layer.__builtin__) {
                    ctx.drawImage(layer.dom, 0, 0, width, height);
                }
                else if (layer.renderToCanvas) {
                    imageLayer.ctx.save();
                    layer.renderToCanvas(imageLayer.ctx);
                    imageLayer.ctx.restore();
                }
            });
        }
        else {
            // PENDING, echarts-gl and incremental rendering.
            var scope = {};
            var displayList = this.storage.getDisplayList(true);
            for (var i = 0; i < displayList.length; i++) {
                var el = displayList[i];
                this._doPaintEl(el, imageLayer, true, scope);
            }
        }

        return imageLayer.dom;
    }
function (opts) {
        opts = opts || {};
        if (this._singleCanvas && !this._compositeManually) {
            return this._layers[CANVAS_ZLEVEL].dom;
        }

        var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);
        imageLayer.initContext();
        imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);

        if (opts.pixelRatio <= this.dpr) {
            this.refresh();

            var width = imageLayer.dom.width;
            var height = imageLayer.dom.height;
            var ctx = imageLayer.ctx;
            this.eachLayer(function (layer) {
                if (layer.__builtin__) {
                    ctx.drawImage(layer.dom, 0, 0, width, height);
                }
                else if (layer.renderToCanvas) {
                    imageLayer.ctx.save();
                    layer.renderToCanvas(imageLayer.ctx);
                    imageLayer.ctx.restore();
                }
            });
        }
        else {
            // PENDING, echarts-gl and incremental rendering.
            var scope = {};
            var displayList = this.storage.getDisplayList(true);
            for (var i = 0; i < displayList.length; i++) {
                var el = displayList[i];
                this._doPaintEl(el, imageLayer, true, scope);
            }
        }

        return imageLayer.dom;
    }
function ( opts ) { opts = opts || { } ; if ( this . _singleCanvas && ! this . _compositeManually ) { return this . _layers [ CANVAS_ZLEVEL ] . dom ; } var imageLayer = new Layer ( 'image' , this , opts . pixelRatio || this . dpr ) ; imageLayer . initContext ( ) ; imageLayer . clear ( false , opts . backgroundColor || this . _backgroundColor ) ; if ( opts . pixelRatio <= this . dpr ) { this . refresh ( ) ; var width = imageLayer . dom . width ; var height = imageLayer . dom . height ; var ctx = imageLayer . ctx ; this . eachLayer ( function ( layer ) { if ( layer . __builtin__ ) { ctx . drawImage ( layer . dom , 0 , 0 , width , height ) ; } else if ( layer . renderToCanvas ) { imageLayer . ctx . save ( ) ; layer . renderToCanvas ( imageLayer . ctx ) ; imageLayer . ctx . restore ( ) ; } } ) ; } else { // PENDING, echarts-gl and incremental rendering. var scope = { } ; var displayList = this . storage . getDisplayList ( true ) ; for ( var i = 0 ; i < displayList . length ; i ++ ) { var el = displayList [ i ] ; this . _doPaintEl ( el , imageLayer , true , scope ) ; } } return imageLayer . dom ; }
Get canvas which has all thing rendered
@param {Object} opts
@param {string} [opts.backgroundColor]
@param {number} [opts.pixelRatio]
Get canvas which has all thing rendered