DocsChartsSpecialty
SplitLineChart
React example follows below.
ts
import { SplitLineChart } from "@grassroot/charts-react"; const xy = [ { x: "Jan", y: 14 }, { x: "Feb", y: 21 }, { x: "Mar", y: 18 }, { x: "Apr", y: 27 },]; <SplitLineChart data={xy.map((item, index) => ({ ...item, state: index % 2 ? "warning" : "ok" }))} />ts
<script setup lang="ts">import { SplitLineChart } from "@grassroot/charts-vue"; const xy = [ { x: "Jan", y: 14 }, { x: "Feb", y: 21 }, { x: "Mar", y: 18 }, { x: "Apr", y: 27 },];</script> <template> <SplitLineChart :data='xy.map((item, index) => ({ ...item, state: index % 2 ? "warning" : "ok" }))' /></template>ts
import { ChangeDetectionStrategy, Component } from "@angular/core";import { GrassrootSplitLineChart } from "@grassroot/charts-angular"; @Component({ selector: "app-split-line-chart-chart-demo", standalone: true, imports: [GrassrootSplitLineChart], changeDetection: ChangeDetectionStrategy.OnPush, template: `<grassroot-split-line-chart [data]='xy.map((item, index) => ({ ...item, state: index % 2 ? "warning" : "ok" }))' />`,})export class SplitLineChartDemoComponent { readonly xy = [ { x: "Jan", y: 14 }, { x: "Feb", y: 21 }, { x: "Mar", y: 18 }, { x: "Apr", y: 27 }, ];} export default SplitLineChartDemoComponent;ts
<script lang="ts"> import { SplitLineChart } from "@grassroot/charts-svelte"; const xy = [ { x: "Jan", y: 14 }, { x: "Feb", y: 21 }, { x: "Mar", y: 18 }, { x: "Apr", y: 27 }, ];</script> <SplitLineChart data={xy.map((item, index) => ({ ...item, state: index % 2 ? "warning" : "ok" }))} />ts
/** @jsxImportSource solid-js */import { SplitLineChart } from "@grassroot/charts-solid"; const xy = [ { x: "Jan", y: 14 }, { x: "Feb", y: 21 }, { x: "Mar", y: 18 }, { x: "Apr", y: 27 },]; export default function SplitLineChartDemo() { return <SplitLineChart data={xy.map((item, index) => ({ ...item, state: index % 2 ? "warning" : "ok" }))} />;}Installation
bash
pnpm dlx grassroot add chart/split-line-chartbash
npx grassroot@latest add chart/split-line-chartbash
yarn dlx grassroot add chart/split-line-chartbash
bunx grassroot add chart/split-line-chartAPI Reference
| Prop | Type | Default |
|---|---|---|
datarequired | readonly SplitLineSegment[] | — |