Skip to content

Rendering of legends inside _chart.redraw breaks code for legend positioning #1163

@rahulstomar

Description

@rahulstomar

I have implemented code to change legend positions (on "postRender" event) and it was working fine with dc 1.7.4 version but now I am wondering why in dc 2.0.0-beta.30, there is a render call for legends in _chart.redraw function which causes for me to call my legend position code each time even on applying filters. Code specifically in


    _chart.redraw = function () {
        sizeSvg();
        _listeners.preRedraw(_chart);

        var result = _chart._doRedraw();

        if (_legend) {
            _legend.render();
        }

        _chart._activateRenderlets('postRedraw');

        return result;
    };

I believe during redrawing of charts or applying filters, legend rendering won't be needed, only in rendering of charts would we need this legend rendering. So my question is do we still need this rendering?

if (_legend) { _legend.render(); }

Or I might be missing something so may I know why we are using this above condition in redrawing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions