Skip to content

[Feature] Set Dimensions for Downloaded Images in saveAsImage #20981

Open
@fzoboli

Description

@fzoboli

What problem does this feature solve?

The current saveAsImage function in Apache ECharts allows users to download charts as images, but the dimensions are based on the chart's display size in the browser. This can lead to suboptimal image quality, especially on different screen resolutions.

I propose adding options to specify the width and height for the downloaded image. This would ensure images are always in an optimal format for printing or sharing.

Benefits:

  1. More control over image quality and dimensions.
  2. Consistent representation of charts regardless of display size.
  3. Enhanced usability for presentations and reports.

What does the proposed API look like?

Example Usage:

saveAsImage({ type: 'png', // Image type width: 800, // Desired width pixelRatio: 1 // Image resolution });

Metadata

Metadata

Assignees

No one assigned

    Labels

    enThis issue is in Englishnew-featurependingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions