Skip to content

[Feature] Option to suppress "Can't get DOM width or height" warnings #18677

@lukeatkins

Description

@lukeatkins

What problem does this feature solve?

Example: I have a page with lots of charts and a tab-like interface.
Content on the inactive tabs in invisible (display: none), so any charts on that tab will have no width or height.
When I change tabs I call the resize() function on all charts.
This warning floods the console log.

What does the proposed API look like?

Perhaps an extra option in the echarts init function called "suppressDOMSizeWarnings"

echarts.init(dom: HTMLDivElement|HTMLCanvasElement, theme?: Object|string, opts?: {
    suppressDOMSizeWarnings?: boolean, //true to disable "Can't get DOM width or height" warnings
    devicePixelRatio?: number,
    renderer?: string,
    useDirtyRect?: boolean,     // Since `5.0.0`
    useCoarsePointer?: boolean, // Since `5.4.0`
    pointerSize?: number,       // Since `5.4.0`
    ssr?: boolean,              // Since `5.3.0`
    width?: number|string,
    height?: number|string,
    locale?: string             // Since `5.0.0`
}) => ECharts

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishsupport

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions