DocsChartsHierarchy
SunburstChart
React example follows below.
ts
import { SunburstChart } from "@grassroot/charts-react"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ],}; <SunburstChart root={hierarchy} />ts
<script setup lang="ts">import { SunburstChart } from "@grassroot/charts-vue"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ],};</script> <template> <SunburstChart :root='hierarchy' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootSunburstChart } from "@grassroot/charts-angular"; @Component({ selector: "app-sunburst-chart-chart-demo", standalone: true, imports: [GrassrootSunburstChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-sunburst-chart [root]='hierarchy' />`,})export class SunburstChartDemoComponent { readonly hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ], };} export default SunburstChartDemoComponent;ts
<script lang="ts"> import { SunburstChart } from "@grassroot/charts-svelte"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ], };</script> <SunburstChart root={hierarchy} />ts
/** @jsxImportSource solid-js */import { SunburstChart } from "@grassroot/charts-solid"; const hierarchy = { label: "portfolio", children: [ { label: "Platform", value: 18 }, { label: "Product", children: [{ label: "Charts", value: 12 }, { label: "Catalog", value: 7 }] }, ],}; export default function SunburstChartDemo() { return <SunburstChart root={hierarchy} />;}Installation
bash
pnpm dlx grassroot add chart/sunburst-chartbash
npx grassroot@latest add chart/sunburst-chartbash
yarn dlx grassroot add chart/sunburst-chartbash
bunx grassroot add chart/sunburst-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
rootrequired | HierarchyDatum | — |