### [[2025]]年 - [[2025-06|06月]], [[2025-06-20|<]] [[第172天]] [[2025-06-22|>]] , 土曜日 --- ## 記事 1100+370 1470 * 0.055 80+5 扫码 3900+9570+16830+5000+1627+9400 4950+6470+18951+19140+2371+14520+10505+10653+19118+11670+4150+10000+5000+4600+11400+5550+8850+4850+4200 46327+176948 223275 * 0.9 200947 * 0.0495 4200+4850+8850+5550 23450 * 0.9 21105 * 0.0495 Merucari 750 * 0.93 * 0.0495 付款 668+410+410+400+400+400+400 3088 * 0.0495 #### 出账 ##### 货款 ###### amex Oamex:: 3300 ![image.png](https://beday.top/bednight/202506211750506179.png) 4180-220-660 ###### tongyi Otongyi:: 3200 ###### nashiga Onashiga:: ##### 消耗 ###### tongyi Utongyi:: 10000 ###### nashiga Unashiga:: ##### 工资 ###### tongyi Stongyi:: ###### nashiga Snashiga:: #### 入账 ###### tongyi Inashiga:: 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