Add download feature on mining charts

This commit is contained in:
nymkappa
2022-05-05 16:18:28 +09:00
parent 953f9405fc
commit e8bb18fbc3
14 changed files with 172 additions and 9 deletions

View File

@@ -77,3 +77,12 @@ export const formatterXAxisTimeCategory = (
return date.toLocaleDateString(locale, { year: 'numeric', month: 'long' });
}
};
export const download = (href, name) => {
var a = document.createElement('a');
a.download = name;
a.href = href;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
};