### [[2025]]年 - [[2025-07|07月]], [[2025-07-12|<]] [[第194天]] [[2025-07-14|>]] , 日曜日 --- ## 記事 [Lily / Relent lily【#VocaDuo2025】 - ニコニコ動画](https://www.nicovideo.jp/watch/sm45158654) #### 出账 ##### 货款 ###### amex Oamex:: ###### tongyi Otongyi:: ###### nashiga Onashiga:: ##### 消耗 ###### tongyi Utongyi:: ###### nashiga Unashiga:: ##### 工资 ###### tongyi Stongyi:: ###### nashiga Snashiga:: #### 入账 ###### tongyi Inashiga:: 117 Itongyi:: ```dataviewjs const d = dv.current() // === 原始字段 === const amex = d.Oamex || 0 const tongyi = d.Otongyi || 0 const nashiga = d.Onashiga || 0 const use_tongyi = d.Utongyi || 0 const use_nashiga = d.Unashiga || 0 const sal_tongyi = d.Stongyi || 0 const sal_nashiga = d.Snashiga || 0 // === 汇总值 === const oOUTall = amex + tongyi + nashiga const oUSEall = use_tongyi + use_nashiga const oSALall = sal_tongyi + sal_nashiga const oALL = oOUTall + oUSEall + oSALall // === Chart 配置 === const chartData = { type: 'doughnut', data: { labels: [ '总货款', '总消耗', '总工资' ], datasets: [ { label: '总支出分类', data: [oOUTall, oUSEall, oSALall], backgroundColor: [ 'rgba(75, 192, 192, 0.6)', // OUT 'rgba(153, 102, 255, 0.6)', // USE 'rgba(255, 159, 64, 0.6)' // SAL ], borderColor: [ 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 } ] }, options: { responsive: true, cutout: '50%', plugins: { legend: { position: 'bottom' }, tooltip: { enabled: true }, centerText: { display: true, text: `总支出:¥${oALL.toLocaleString()}` } } }, plugins: [ { id: 'centerText', beforeDraw: function (chart) { const width = chart.width; const height = chart.height; const ctx = chart.ctx; ctx.restore(); const fontSize = (height / 150).toFixed(2); ctx.font = `${fontSize}em sans-serif`; ctx.textBaseline = 'middle'; const text = chart.options.plugins.centerText.text; const textX = Math.round((width - ctx.measureText(text).width) / 2); const textY = height / 2; ctx.fillText(text, textX, textY); ctx.save(); } } ] } window.renderChart(chartData, this.container) ``` --- # memos 1100+1000+14400+800+8800+400+15100+11000+2500+1000+2000+4500+2600+11200+4700+9000+5600+3000+200+600 4500+9500+1500+1000+3000+2800+3200+600+4200+400+2400+7600+2500+7500+2400+2000+500+1000+700+1800 127+370+892+38+585+50+965+70+732+40+333+325+190+780+350+610+390+215+55+70+135+90+200+180+50+120+40+216 110400 * 0.05 8218-5520 2698-460-460-500 4500+500 5000 * 0.05 250+10 260+30