feat(chart-area): add series statistics display and computation for chart data

This commit is contained in:
2026-04-03 10:35:52 +00:00
parent ad732a3e68
commit 7295bfcf92
3 changed files with 76 additions and 4 deletions

View File

@@ -6,7 +6,20 @@ export const renderChartArea = (component: DeesChartArea): TemplateResult => {
<div class="mainbox">
<div class="chartTitle">${component.label}</div>
<div class="chartContainer"></div>
${component.seriesStats.length > 0 ? html`
<div class="statsBar">
${component.seriesStats.map(s => html`
<div class="statsSeries">
<span class="statsColor" style="background:${s.color}"></span>
<span class="statsName">${s.name}</span>
<span class="statsItem">latest <strong>${component.yAxisFormatter(s.latest)}</strong></span>
<span class="statsItem">min <strong>${component.yAxisFormatter(s.min)}</strong></span>
<span class="statsItem">max <strong>${component.yAxisFormatter(s.max)}</strong></span>
<span class="statsItem">avg <strong>${component.yAxisFormatter(s.avg)}</strong></span>
</div>
`)}
</div>
` : ''}
</div>
`;
};