Add a chart view to databases

Bars, a line or a donut of the view's records, counted or with a
number property summed or averaged, per choice, checkbox, person or
month of a date. Drawn as SVG in the theme's colours; bars and slices
take a choice's colour. The view's filters apply. The chart settings
redraw themselves, so the number property appears for sums and
averages and a change keeps the others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-17 13:25:26 +01:00
1 parent d3c4d1f57a
commit fa17016456
13 files changed
+512 -10

No files matched your search

+107
View File
@@ -1902,6 +1902,106 @@
}
}
/* ---- Chart view ---- */
.dw-db-ch {
padding: 12px 0 4px;
}
.dw-db-ch__scroll {
overflow-x: auto;
}
.dw-db-ch__svg {
display: block;
max-width: none;
overflow: visible;
font-family: inherit;
}
.dw-db-ch__grid {
stroke: var(--color-line);
stroke-width: 1;
}
.dw-db-ch__tick,
.dw-db-ch__label {
fill: var(--color-ink-muted);
font-size: 11px;
}
.dw-db-ch__value {
fill: var(--color-ink);
font-size: 11px;
font-weight: 600;
}
.dw-db-ch__bar {
fill: var(--dw-c, var(--color-accent));
opacity: 0.85;
}
.dw-db-ch__bar:hover {
opacity: 1;
}
.dw-db-ch__line {
fill: none;
stroke: var(--color-accent);
stroke-width: 2;
stroke-linejoin: round;
}
.dw-db-ch__dot {
fill: var(--color-surface);
stroke: var(--color-accent);
stroke-width: 2;
}
.dw-db-ch__pie {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px 32px;
}
.dw-db-ch__slice {
fill: none;
stroke: var(--dw-c, var(--color-accent));
stroke-width: 28;
}
.dw-db-ch__slice:hover {
stroke-width: 32;
}
.dw-db-ch__total {
fill: var(--color-ink);
font-size: 22px;
font-weight: 600;
}
.dw-db-ch__legend {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
margin: 0;
padding: 0;
list-style: none;
font-size: 13px;
}
.dw-db-ch__legend li {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.dw-db-ch__swatch {
flex: none;
width: 10px;
height: 10px;
border-radius: 2px;
background: var(--dw-c, var(--color-accent));
}
.dw-db-ch__name {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dw-db-ch__num {
margin-left: auto;
padding-left: 12px;
color: var(--color-ink-muted);
font-variant-numeric: tabular-nums;
}
/* ---- Timeline view ---- */
.dw-db-tl {
padding-top: 8px;
@@ -2364,6 +2464,13 @@
.dw-db-pop--panel {
min-width: 20rem;
}
/* Parts of a panel that redraw themselves keep the panel's column layout. */
.dw-db-pop__chart,
.dw-db-pop__props {
display: flex;
flex-direction: column;
gap: 6px;
}
.dw-db-pop--choices {
width: 18rem;
}