diff --git a/frontend/js/components/dashboard.js b/frontend/js/components/dashboard.js index 482fdf9..7e32576 100755 --- a/frontend/js/components/dashboard.js +++ b/frontend/js/components/dashboard.js @@ -1285,7 +1285,7 @@ const Dashboard = (() => { if(!canvas) return; const ctx = canvas.getContext('2d'); const dpr = window.devicePixelRatio || 1; - const size = 280; // 足够容纳引出线 + const size = 360; // 足够容纳四周引出线文字 canvas.width = size * dpr; canvas.height = size * dpr; canvas.style.width = size + 'px'; @@ -1601,10 +1601,10 @@ const Dashboard = (() => { if(!segs || segs.length === 0 || !tot) return; const rect = shipmentDonutCanvas.getBoundingClientRect(); - const scaleX = shipmentDonutCanvas.offsetWidth > 0 ? (280 / shipmentDonutCanvas.offsetWidth) : 1; - const scaleY = shipmentDonutCanvas.offsetHeight > 0 ? (280 / shipmentDonutCanvas.offsetHeight) : 1; - const rx = (e.clientX - rect.left) * scaleX - 140; - const ry = (e.clientY - rect.top) * scaleY - 140; + const scaleX = shipmentDonutCanvas.offsetWidth > 0 ? (360 / shipmentDonutCanvas.offsetWidth) : 1; + const scaleY = shipmentDonutCanvas.offsetHeight > 0 ? (360 / shipmentDonutCanvas.offsetHeight) : 1; + const rx = (e.clientX - rect.left) * scaleX - 180; + const ry = (e.clientY - rect.top) * scaleY - 180; const dist = Math.sqrt(rx * rx + ry * ry); if(dist < 56 || dist > 100) { @@ -2244,10 +2244,10 @@ const Dashboard = (() => {