Skip to content

Commit 9950a77

Browse files
committed
feat(playground): chart-click cross-filter on metric-views region + segment charts
Wire the new appkit-ui chart props into the metric-views demo: the region BarChart and segment DonutChart get onDataClick={(d) => setDimension(dim, d.name)} — reusing the same setDimension the table row-click uses — and selected={selection[dim]} so the clicked category is emphasized. LineChart, Table, and the existing (keyboard-accessible) table row-click are unchanged. Co-authored-by: Isaac Signed-off-by: Atila Fassina <atila@fassina.eu>
1 parent c52b897 commit 9950a77

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/dev-playground/client/src/routes/metric-views.route.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ function MetricViewsRoute() {
330330
yKey="arr"
331331
height={280}
332332
title="Annual recurring revenue by region"
333+
onDataClick={(d) => setDimension("region", d.name)}
334+
selected={selection.region}
333335
/>
334336
)}
335337
</CardContent>
@@ -361,6 +363,8 @@ function MetricViewsRoute() {
361363
innerRadius={55}
362364
showLegend
363365
title="Annual recurring revenue by segment"
366+
onDataClick={(d) => setDimension("segment", d.name)}
367+
selected={selection.segment}
364368
/>
365369
)}
366370
</CardContent>

0 commit comments

Comments
 (0)