Page MenuHomePhabricator

Add button to download charts as PNGs
Open, MediumPublic3 Estimated Story Points

Description

Charts can be downloaded on desktop by right-clicking the canvas, but it is not as easy on mobile. A button to download the image would make it easier. If possible, the downloaded images should all have the same dimensions, regardless of screen size or page zoom level.

The button should be added between the chart and the filters.

Image:

image.png (1,334×180 px, 30 KB)

Solution:

Convert the chart’s canvas to a Base64 string and export that through a temporary download link. However, this solution will most likely keep the canvas’ resolution and so be dependent on the current zoom level and screen width.

const chartDataURL = chart.toBase64Image();
const link = document.createElement("a");
link.href = chartDataURL;
link.download = `${chart_type}_${snapshot_date}.png`;
link.click();

Related Objects

StatusSubtypeAssignedTask
OpenDanya
OpenNone

Event Timeline

Danya triaged this task as Medium priority.
Danya moved this task from Backlog to [deleted] on the Tool-wiki-gender-stats board.
Danya updated the task description. (Show Details)
Danya set the point value for this task to 3.
Danya updated the task description. (Show Details)