### [[2025]]年 - [[2025-07|07月]], [[2025-07-09|<]] [[第191天]] [[2025-07-11|>]] , 木曜日 --- ## 記事 #### 出账 ##### 货款 ###### amex Oamex:: 118379 7315+31222+4753+7000+12100+1892+8440+36980+1430+1057+1136+5054 ###### tongyi Otongyi:: 25600 1370+22730+1500 Otongyi1:: 47081 7000+4261+3270+210+1600+25740+2800+2200 37840-12100 ###### nashiga Onashiga:: 7448 1500+499+1350+3599+500 ##### 消耗 ###### tongyi Utongyi:: 20400 8200打印机 400退款 6000退款 5800手机 8200+400+6000+5800 ###### nashiga Unashiga:: ##### 工资 ###### tongyi Stongyi:: 2000 ###### nashiga Snashiga:: #### 入账 ###### tongyi Inashiga:: 6614 3385+540+135+116+174+147+117+110+127+439+410+620+124+170 Itongyi:: 1678 112+92+150+108+133+132+62+122+137+56+140+312+122 ```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 710+175+190+180+160+180+120+225+160+160+155+145+170+170+150+265+285+155 3755-370 115+100+245+190+180+150+200+180+150+150+210+130+130+130+330+12025+540+220 15375-10000 一开始 60000-12000 = 48000 我给了你3874yuan变成了78682yen 48000+78682 = 126682 150 * 28 12000-4200-740