import type {Story} from '@storybook/react';
import {DEFAULT_THEME} from '../../../constants';
import type {ComboChartProps} from '../../ComboChart';
import {LinePreview, SquareColorPreview} from '../..';
import {DEFAULT_DATA, Template} from './data';
export {META as default} from './meta';
const LEGEND_ITEMS_DATA = [
{
name: 'POS',
preview: (
),
},
{
name: 'Online',
preview: ,
},
{
name: 'Mobile',
preview: (
),
},
{
name: 'Sessions from Google ads',
preview: (
),
},
{
name: 'Sessions from Facebook ads',
preview: (
),
},
];
const liStyles = {
alignItems: 'center',
color: 'white',
display: 'flex',
fontWeight: 'bold',
gap: 4,
listStyleType: 'none',
};
export const InteractiveCustomLegend: Story = Template.bind(
{},
);
InteractiveCustomLegend.args = {
data: DEFAULT_DATA,
xAxisOptions: {
labelFormatter: (value: string) => {
return new Date(value).toLocaleDateString('en-CA', {
month: 'long',
day: 'numeric',
year: 'numeric',
});
},
},
renderLegendContent: ({getColorVisionStyles, getColorVisionEventAttrs}) => (
{LEGEND_ITEMS_DATA.map(({name, preview}, index) => (
-
{preview}
{name}
))}
),
};