Skip to content

Commit

Permalink
feat: add dynamic Chart options (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0ftik3 committed Dec 24, 2023
1 parent e57192d commit 9cf368b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ export default function DefaultChart(props: ChartProps) {
),
)

createEffect(
on(
() => merged.options,
() => {
chart()!.options = merged.options
chart()!.update()
},
{
defer: true,
},
),
)

createEffect(
on(
[() => merged.width, () => merged.height],
Expand Down

0 comments on commit 9cf368b

Please sign in to comment.