2025-09-19 15:26:21 +00:00
|
|
|
import { html, type TemplateResult } from '@design.estate/dees-element';
|
|
|
|
|
import type { DeesChartArea } from './component.js';
|
|
|
|
|
|
|
|
|
|
export const renderChartArea = (component: DeesChartArea): TemplateResult => {
|
|
|
|
|
return html`
|
2026-04-03 11:49:58 +00:00
|
|
|
<dees-tile .heading=${component.label}>
|
2025-09-19 15:26:21 +00:00
|
|
|
<div class="chartContainer"></div>
|
2026-04-03 10:35:52 +00:00
|
|
|
${component.seriesStats.length > 0 ? html`
|
2026-04-03 11:49:58 +00:00
|
|
|
<div slot="footer" class="statsBar">
|
2026-04-03 10:35:52 +00:00
|
|
|
${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>
|
|
|
|
|
` : ''}
|
2026-04-03 11:49:58 +00:00
|
|
|
</dees-tile>
|
2025-09-19 15:26:21 +00:00
|
|
|
`;
|
|
|
|
|
};
|