Add chart download feature

This commit is contained in:
yuuki
2024-01-12 09:21:17 +00:00
parent 2200ec5944
commit 2b93dc0922
2 changed files with 334 additions and 3 deletions

View File

@@ -1059,8 +1059,12 @@
var ctx = config.ctx
ctx.save()
if(config.iconName === "back"){
if(config.iconName === "download" ||config.iconName === "back"){
ctx.translate(config.x - 21, config.y - 21)
if(config.iconName === "download"){
ctx.rotate(Math.PI)
ctx.translate(-42, -42)
}
var drawLine = y => {
ctx.beginPath()
@@ -1091,8 +1095,8 @@
drawLine(11)
drawTriangle()
ctx.translate(-1.5, -0.5)
ctx.fillStyle = "#23a6e1"
ctx.strokeStyle = "#23a6e1"
ctx.fillStyle = config.iconName === "download" ? "#a08eea" : "#23a6e1"
ctx.strokeStyle = config.iconName === "download" ? "#a08eea" : "#23a6e1"
ctx.globalCompositeOperation = "darken"
drawLine(11)
drawTriangle()