Skip to content

Commit

Permalink
add legend to storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
annacmc committed Dec 12, 2024
1 parent f064255 commit 2605cba
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { BaseLegend } from '../index';
import type { Meta } from '@storybook/react';

const data = [
{ label: 'Desktop', value: '86%', color: '#3858E9' },
{ label: 'Mobile', value: '52%', color: '#80C8FF' },
];

export default {
title: 'JS Packages/Charts/Legend',
component: BaseLegend,
parameters: {
layout: 'centered',
docs: {
description: {
component:
'A flexible legend component that can be customized with different styles and orientations.',
},
},
},
} satisfies Meta< typeof BaseLegend >;

const Template = args => <BaseLegend { ...args } />;

export const Default = Template.bind( {} );
Default.args = {
items: data,
orientation: 'horizontal',
};

export const Vertical = Template.bind( {} );
Vertical.args = {
items: data,
orientation: 'vertical',
};

0 comments on commit 2605cba

Please sign in to comment.