Skip to content

Commit

Permalink
Explicitely export to PNG
Browse files Browse the repository at this point in the history
  • Loading branch information
nerik committed Nov 17, 2022
1 parent f8c0e20 commit 4bc2842
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/scripts/components/analysis/results/chart-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function ChartCard(props: ChartCardProps) {
<DropMenuItemButton
onClick={(e) => onExportClick(e, 'image')}
>
Image (JPG)
Image (PNG)
</DropMenuItemButton>
</li>
<li>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/common/chart/analysis/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default React.forwardRef<AnalysisChartRef, AnalysisChartProps>(
lineColors: props.colors
})
});
FileSaver.saveAs(chartImageUrl, `${name}.jpg`);
FileSaver.saveAs(chartImageUrl, `${name}.png`);
}
}),
[uniqueKeys, props.colors, altTitle]
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/components/common/chart/analysis/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ function drawOnCanvas({
legendHeight
);

const jpg = c.toDataURL('image/jpg');
return jpg;
const png = c.toDataURL();
return png;
}

function loadImageWithPromise(url: string) {
Expand Down

0 comments on commit 4bc2842

Please sign in to comment.