Skip to content

Commit

Permalink
add more examples for barchart
Browse files Browse the repository at this point in the history
  • Loading branch information
PixeledCode committed Jan 1, 2024
1 parent 5f1ccde commit 1f362e5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions packages/opub-ui/src/components/BarChart/BarChart.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,37 @@ export const Default: Story = {
],
},
};

export const yAxis: Story = {
name: 'yAxis',
args: {
yAxis: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
series: [
{
name: 'Sales',
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
},
],
height: '500px',
},
};

export const Grouped: Story = {
args: {
yAxis: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World'],
series: [
{
name: '2011',
type: 'bar',
data: [18203, 23489, 29034, 104970, 131744, 630230],
},
{
name: '2012',
type: 'bar',
data: [19325, 23438, 31000, 121594, 134141, 681807],
},
],
height: '500px',
},
};
4 changes: 2 additions & 2 deletions packages/opub-ui/src/components/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import { SVGRenderer } from 'echarts/renderers';
type Props = {
/* xAxis of the chart */
xAxis?: string[] | number[];
/* yAxis of the chart */
yAxis?: string[] | number[];
/* Data to be displayed on the chart */
series: {
name: string;
type: string;
data: number[];
}[];
/* yAxis of the chart */
yAxis?: string[] | number[];
/* Theme of the chart */
theme?: EChartsReactProps['theme'];
/* Callback function to be called when the chart is ready */
Expand Down

1 comment on commit 1f362e5

@vercel
Copy link

@vercel vercel bot commented on 1f362e5 Jan 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

opub-www – ./apps/www

opub-www-civicdatalab.vercel.app
opub-www-git-main-civicdatalab.vercel.app
opub-www.vercel.app

Please sign in to comment.