Skip to content

Commit

Permalink
Add test data
Browse files Browse the repository at this point in the history
  • Loading branch information
susiekims committed Jan 25, 2024
1 parent 1ff96f2 commit eba224a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Story} from '@storybook/react';

import {LineChart, LineChartProps} from '../../LineChart';
import {randomNumber} from '../../../Docs/utilities';
import {generateDataSet, randomNumber} from '../../../Docs/utilities';
import {
formatLinearXAxisLabel,
formatLinearYAxisLabel,
Expand Down Expand Up @@ -1023,3 +1023,47 @@ LinearComparisonTooltip.args = {
},
],
};

export const LongLegend: Story<LineChartProps> = Template.bind({});

LongLegend.args = {
data: [
{
name: 'Garlic & Herb Biltong Slab - Family Size Super Pack',
data: generateDataSet(10, 'dates'),
},
{
name: 'Chili Biltong Slab 8oz',
data: generateDataSet(10, 'dates'),
},
{
name: 'Sale',
data: generateDataSet(10, 'dates'),
},
{
name: '1',
data: generateDataSet(10, 'dates'),
},
{
name: 'Smokehouse Biltong',
data: generateDataSet(10, 'dates'),
},
{
name: 'Traditional Biltong Slab 8oz',
data: generateDataSet(10, 'dates'),
},
{
name: '2',
data: generateDataSet(10, 'dates'),
},
{
name: 'A Very Very Very Very Very Long Titled Biltong',
data: generateDataSet(10, 'dates'),
},

{
name: '3',
data: generateDataSet(10, 'dates'),
},
],
};
2 changes: 1 addition & 1 deletion packages/polaris-viz/src/storybook/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const RENDER_LEGEND_CONTENT_ARGS = {

export const HIDE_LEGEND_OVERFLOW_CONTROL_ARGS = {
description:
'Used to hide legend items that do not fit in the Chart container. If there are hidden items, a default label "+{n} more" will be rendered that will render the hidden items in a tooltip on hover.',
'Used to hide legend items that do not fit in the chart container. If there are hidden items, a default label "+{n} more" will be rendered that will show the hidden items in a tooltip on hover.',
control: {
type: 'boolean',
},
Expand Down

0 comments on commit eba224a

Please sign in to comment.