From 38e4fb93af07aa89b3210a449c19043b636d031d Mon Sep 17 00:00:00 2001 From: joaosa Date: Mon, 22 Apr 2024 12:02:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Update=20bar-sparkline=20playgro?= =?UTF-8?q?und=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/playground/bar-sparkline.stories.ts | 27 +++--- packages/lib/src/playground/bar-sparkline.vue | 96 ++++++++++++++++--- 2 files changed, 98 insertions(+), 25 deletions(-) diff --git a/packages/lib/src/playground/bar-sparkline.stories.ts b/packages/lib/src/playground/bar-sparkline.stories.ts index cd78e231..40b1ce38 100644 --- a/packages/lib/src/playground/bar-sparkline.stories.ts +++ b/packages/lib/src/playground/bar-sparkline.stories.ts @@ -7,31 +7,30 @@ export default { options: { control: 'object', }, + barWidth: { control: { type: 'number' } }, + gap: { control: { type: 'number' } }, + height: { control: { type: 'number' } }, }, args: { - options: { - margins: { top: 0, right: 0, bottom: 0, left: 0 }, - withAxes: false, - withHover: false, - withLegend: false, - noMinSize: true, - }, data: [ { values: [ 20, 50, 30, - 35, - { value: 70, color: '09' }, + 60, { value: 80, color: '09' }, { value: 75, color: '09' }, ], - label: 'Emojis', + label: 'Abandoned pets', type: 'line', + color: 'green', }, ], - labels: ['Cops', 'Frits!', 'Beer', '8 ball', 'Bear', 'Dogger', 'Barber'], + labels: [0, 1, 2, 3, 4, 5], + barWidth: 12, + gap: 2, + height: 20, }, }; @@ -42,9 +41,9 @@ export const Basic = ({ args }) => { return { args }; }, template: ` -
- -
+
+ +
`, }; }; diff --git a/packages/lib/src/playground/bar-sparkline.vue b/packages/lib/src/playground/bar-sparkline.vue index c422d84b..f8400d24 100644 --- a/packages/lib/src/playground/bar-sparkline.vue +++ b/packages/lib/src/playground/bar-sparkline.vue @@ -1,23 +1,97 @@ - - +