Skip to content

Commit

Permalink
Add bar chart
Browse files Browse the repository at this point in the history
  • Loading branch information
raix committed Jul 14, 2024
1 parent 3785b83 commit 6120fd5
Show file tree
Hide file tree
Showing 8 changed files with 397 additions and 20 deletions.
5 changes: 5 additions & 0 deletions docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"link": "/components/introduction",
"activeMatch": "/components/"
},
{
"text": "Charts",
"link": "/charts/introduction",
"activeMatch": "/charts/"
},
{
"text": "Templates",
"link": "/templates/introduction",
Expand Down
8 changes: 8 additions & 0 deletions docs/charts/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"introduction",
{
"type": "dir",
"label": "Basic Charts",
"name": "basic"
}
]
58 changes: 58 additions & 0 deletions docs/charts/basic/bar-chart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# BarChart

BarChart is a component that displays data in a bar chart format.

```tsx preview
import { BarChart } from '@/ui/charts/BarChart';

const data: GroupedData<"uv" | "pv" | "av">[] = [
{
name: "Page A",
uv: 4000,
pv: 2400,
av: 2400
},
{
name: "Page B",
uv: 3000,
pv: 1398,
av: 2400
},
{
name: "Page C",
uv: 2000,
pv: 9800,
av: 2400
},
{
name: "Page D",
uv: 2780,
pv: 3908,
av: 2400
},
{
name: "Page E",
uv: 1890,
pv: 4800,
av: 2400
},
{
name: "Page F",
uv: 2390,
pv: 3800,
av: 2400
},
{
name: "Page G",
uv: 3490,
pv: 4300,
av: 2400
}
];

export default function Example() {
return (
<BarChart data={data} />
);
}
```
2 changes: 2 additions & 0 deletions docs/charts/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Charts

Loading

0 comments on commit 6120fd5

Please sign in to comment.