Skip to content

ResponsiveContainer does not resize before printing #1114

Open
@iamvanja

Description

@iamvanja

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When printing is initiated, ResponsiveContainer re-uses the chart size from the window and does not scale properly regardless of the print specific outer container (green border) and ResponsiveContainer (red border) fixed dimensions.

If the current behavior is a bug, please provide the steps to reproduce

See screenshot
screen shot 2017-12-26 at 20 51 27

What is the expected behavior?

ResponsiveContainer should resize to the specified fixed dimensions.

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

1.0.0-beta.6, all browsers.

I understand printing may be out of scope of this project, but I am also hoping someone can offer a suggestion on how to solve this.
After focusing on CSS-only solution which does not work since the chart is not resized, my next solution will be to listen to print events and conditionally set fixed dimensions although this solution is pretty messy and involved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement to a current API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions