Download chakra-ui/apps/compositions/src/examples/charts/bar-segment-basic.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 675 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/apps/compositions/src/examples/charts/bar-segment-basic.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/apps/compositions/src/examples/charts/bar-segment-basic.tsx
-
curl -L -o bar-segment-basic.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/chakra-ui/apps/compositions/src/examples/charts/bar-segment-basic.tsx
675 Bytes
| "use client" | |
| import { BarSegment, useChart } from "@chakra-ui/charts" | |
| export const BarSegmentBasic = () => { | |
| const chart = useChart({ | |
| sort: { by: "value", direction: "desc" }, | |
| data: [ | |
| { name: "Google", value: 500000, color: "teal.solid" }, | |
| { name: "Direct", value: 100000, color: "blue.solid" }, | |
| { name: "Bing", value: 200000, color: "orange.solid" }, | |
| { name: "Yandex", value: 100000, color: "purple.solid" }, | |
| ], | |
| }) | |
| return ( | |
| <BarSegment.Root chart={chart}> | |
| <BarSegment.Content> | |
| <BarSegment.Value /> | |
| <BarSegment.Bar /> | |
| <BarSegment.Label /> | |
| </BarSegment.Content> | |
| </BarSegment.Root> | |
| ) | |
| } | |