@mozaic-ds/chart 0.1.0-beta.0 → 0.1.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/mozaic-chart.js +3390 -2582
  2. package/dist/mozaic-chart.umd.cjs +11 -11
  3. package/dist/style.css +1 -1
  4. package/package.json +38 -24
  5. package/src/components/bar/BarChart.stories.ts +13 -9
  6. package/src/components/bar/BarChart.vue +234 -106
  7. package/src/components/bar/index.ts +8 -0
  8. package/src/components/doughnut/DoughnutChart.stories.ts +3 -0
  9. package/src/components/doughnut/DoughnutChart.vue +205 -95
  10. package/src/components/doughnut/index.ts +8 -0
  11. package/src/components/index.ts +4 -0
  12. package/src/components/line/LineChart.stories.ts +0 -1
  13. package/src/components/line/LineChart.vue +310 -219
  14. package/src/components/line/index.ts +8 -0
  15. package/src/components/mixed/MixedBarLineChart.stories.ts +87 -0
  16. package/src/components/mixed/MixedBarLineChart.vue +404 -0
  17. package/src/components/mixed/index.ts +8 -0
  18. package/src/components/radar/RadarChart.stories.ts +2 -2
  19. package/src/components/radar/RadarChart.vue +231 -126
  20. package/src/components/radar/index.ts +8 -0
  21. package/src/main.ts +2 -1
  22. package/src/plugin.ts +19 -0
  23. package/src/services/BarChartFunctions.ts +16 -20
  24. package/src/services/ChartsCommonLegend.ts +54 -47
  25. package/src/services/ColorFunctions.ts +4 -0
  26. package/src/services/DoughnutChartFunctions.ts +111 -59
  27. package/src/services/FormatUtilities.ts +1 -1
  28. package/src/services/GenericTooltipService.ts +55 -34
  29. package/src/services/MixedBarLineFunctions.ts +280 -0
  30. package/src/services/RadarChartFunctions.ts +13 -11
  31. package/src/services/patterns/ChartDesign.ts +15 -9
  32. package/src/services/patterns/patternCircles.ts +63 -50
  33. package/src/services/patterns/patternDashedDiagonals.ts +46 -32
  34. package/src/services/patterns/patternDiagonals.ts +85 -71
  35. package/src/services/patterns/patternSquares.ts +56 -44
  36. package/src/services/patterns/patternVerticalLines.ts +41 -28
  37. package/src/services/patterns/patternZigzag.ts +20 -7
  38. package/src/stories/Changelog.mdx +6 -0
  39. package/src/stories/Contributing.mdx +101 -0
  40. package/src/stories/GettingStarted.mdx +92 -0
  41. package/src/stories/SupportAndOnboarding.mdx +44 -0
  42. package/src/types/MixedBarLineData.ts +7 -0
  43. package/src/types/TooltipChartType.ts +1 -0
@@ -1,180 +1,265 @@
1
1
  <template>
2
2
  <div class="container">
3
3
  <div class="main">
4
- <Line
5
- v-if="chartData"
6
- ref="cockpitLineChartRef"
7
- :data="chartData"
8
- :options="options"
9
- :plugins='htmlLegendPlugin'
10
- :chart-id='chartId'
11
- :cssClasses:='cssClasses'
12
- :styles='styles'
13
- :style='{ width, height, cursor:"pointer"}'
14
- />
15
- </div>
16
- <div ref="legendContainer" />
4
+ <Line
5
+ v-if="chartData"
6
+ ref="lineChartRef"
7
+ :id="chartId"
8
+ :data="chartData"
9
+ :options="options"
10
+ :plugins="htmlLegendPlugin"
11
+ :class="cssClasses"
12
+ :style="[{ width, height, cursor: 'pointer' }, styles]"
13
+ />
14
+ </div>
15
+ <div ref="legendContainer" />
17
16
  </div>
18
- </template>
19
-
20
- <script setup lang="ts">
21
-
22
- import type { Ref } from 'vue';
23
- import { computed, ref, PropType } from 'vue';
24
- import { Line } from 'vue-chartjs';
25
- import { LineData } from '../../types/LineChart';
26
- import { GenericTooltipService } from '../../services/GenericTooltipService';
27
- import type { Context } from '../../services/GenericTooltipService';
28
- import { TooltipChartType } from '../../types/TooltipChartType';
29
- import { formatTicks } from '../../services/FormatUtilities';
30
- import type { ChartItem } from '../../services/ChartsCommonLegend';
31
-
32
- import {
33
- createHtmlLegendItemText,
34
- createHtmlLegendListElement,
35
- createLegendElementWithSquareArea,
36
- getOrCreateLegendList,
37
- createLegendCheckbox,
38
- switchItemVisibility
39
- } from '../../services/ChartsCommonLegend';
40
-
41
- import {
42
- CategoryScale,
43
- Chart as ChartJS,
44
- Legend,
45
- LinearScale,
46
- LineElement,
47
- PointElement,
48
- Title,
49
- Tooltip,
50
- Plugin
51
- } from 'chart.js';
52
-
53
- ChartJS.register(
54
- Title,
55
- Tooltip,
56
- Legend,
57
- PointElement,
58
- LineElement,
59
- CategoryScale,
60
- LinearScale
61
- );
62
-
63
- const legendContainer = ref(null);
64
- const selectMode = ref(false);
65
- const lineDataProps = defineProps({
66
- chartId: {
67
- type: String,
68
- default: 'radar-chart',
69
- },
70
- rawTitle: {
71
- type: String,
72
- default: 'sales',
73
- },
74
- width: {
75
- type: String,
76
- default: '200px',
77
- },
78
- height: {
79
- type: String,
80
- default: '400px',
81
- },
82
- lines: {
83
- type: Array as PropType<LineData[]>,
84
- default: () => {},
85
- },
86
- labels: {
87
- type: Array as PropType<string[]>,
88
- default: () => []
89
- },
90
- cssClasses: {
91
- default: '',
92
- type: String,
93
- },
94
- styles: {
95
- type: Object as PropType<Partial<CSSStyleDeclaration>>,
96
- default: () => {},
97
- },
98
- plugins: {
99
- type: Array as PropType<Plugin<'line'>[]>,
100
- default: () => [],
101
- },
102
- })
103
-
104
- const getTooltipData = (context: Context) => {
105
- const datasetIndex = context.tooltip.dataPoints[0].datasetIndex;
106
- const dataIndex = context.tooltip.dataPoints[0].dataIndex;
107
- if (!dataIndex || !datasetIndex) {
108
- return '';
109
- }
110
- const formattedValue = lineDataProps.lines[datasetIndex].data[dataIndex].toFixed(2);
111
- return lineDataProps.lines[datasetIndex].unit ? formattedValue +
112
- ' ' + lineDataProps.lines[datasetIndex].unit
113
- : formattedValue;
17
+ </template>
18
+
19
+ <script setup lang="ts">
20
+ import type { Ref } from 'vue';
21
+ import { computed, ref, PropType } from 'vue';
22
+ import { Line } from 'vue-chartjs';
23
+ import { LineData } from '../../types/LineChart';
24
+ import { GenericTooltipService } from '../../services/GenericTooltipService';
25
+ import type { Context } from '../../services/GenericTooltipService';
26
+ import { TooltipChartType } from '../../types/TooltipChartType';
27
+ import { formatWithThousandsSeprators } from '../../services/FormatUtilities';
28
+ import type { ChartItem } from '../../services/ChartsCommonLegend';
29
+ import ChartDesign from '../../services/patterns/ChartDesign';
30
+
31
+ import {
32
+ createHtmlLegendItemText,
33
+ createHtmlLegendListElement,
34
+ createLegendElementWithSquareArea,
35
+ getOrCreateLegendList,
36
+ createLegendCheckbox,
37
+ switchItemVisibility,
38
+ } from '../../services/ChartsCommonLegend';
39
+
40
+ import {
41
+ CategoryScale,
42
+ Chart as ChartJS,
43
+ Legend,
44
+ LinearScale,
45
+ LineElement,
46
+ PointElement,
47
+ Title,
48
+ Tooltip,
49
+ Plugin,
50
+ } from 'chart.js';
51
+
52
+ ChartJS.register(
53
+ Title,
54
+ Tooltip,
55
+ Legend,
56
+ PointElement,
57
+ LineElement,
58
+ CategoryScale,
59
+ LinearScale
60
+ );
61
+
62
+ const { colourSets, patternsStandardList } = ChartDesign();
63
+
64
+ const legendContainer = ref(null);
65
+ const selectMode = ref(false);
66
+ const lineDataProps = defineProps({
67
+ /**
68
+ * Value of the id attribute present on the <canvas> tag element the chart
69
+ */
70
+ chartId: {
71
+ type: String,
72
+ default: 'radar-chart',
73
+ },
74
+ /**
75
+ * Label of the first line in the Tooltip
76
+ */
77
+ tooltipFirstLineLabel: {
78
+ type: String,
79
+ default: 'content',
80
+ },
81
+ /**
82
+ * Label of the second line in the Tooltip
83
+ */
84
+ tooltipSecondLineLabel: {
85
+ type: String,
86
+ default: 'content2',
87
+ },
88
+ /**
89
+ * Value of the `width` css property used to define the width of the <canvas> element
90
+ */
91
+ width: {
92
+ type: String,
93
+ default: '200px',
94
+ },
95
+ /**
96
+ * Value of the `height` css property used to define the height of the <canvas> element
97
+ */
98
+ height: {
99
+ type: String,
100
+ default: '400px',
101
+ },
102
+ /**
103
+ * Disable accessibility patterns
104
+ */
105
+ disableAccessibility: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
109
+ /**
110
+ * Used to choose the colour set of the charts as defined in the Figma prototypes.
111
+ * 7 colour sets are currently defined:
112
+ * - Default 0 corresponds to the current one
113
+ * - 1 to 6 corresponds to the "new" [colour sets](https://www.figma.com/file/Hn6PyvnR385Ta0XN3KqOI9/04.-Dataviz---Documentation-(read-only)?type=design&node-id=1-69316&mode=design&t=sDytQ5BipsryWkuA-0)
114
+ * Note: All the sets are defined in /src/services/patterns/ChartDesign.ts
115
+ */
116
+ colourSet: {
117
+ type: Number,
118
+ default: 0,
119
+ },
120
+ /**
121
+ * 6 patterns exist and are not randomly given but follow the order defined in [patternsStandardList](/src/services/patterns/ChartDesign.ts)
122
+ * Additionally, a pattern has only one possible colour per colour set as defined in the Figma prototype.
123
+ * In some use cases, the chart may need to show a different orders of these patterns, this can be changed using the props newPatternsOrder
124
+ */
125
+ newPatternsOrder: {
126
+ type: Array as PropType<number[]>,
127
+ default: () => [0, 1, 2, 3, 4, 5],
128
+ },
129
+ /**
130
+ * Line data _(can contain `label`, `data` and `unit` keys)_
131
+ */
132
+ lines: {
133
+ type: Array as PropType<LineData[]>,
134
+ default: () => {},
135
+ },
136
+ /**
137
+ * Labels used to label the index axis (default x axes). See [Data structures documentation](https://www.chartjs.org/docs/latest/general/data-structures.html)
138
+ */
139
+ labels: {
140
+ type: Array as PropType<string[]>,
141
+ default: () => [],
142
+ },
143
+ /**
144
+ * Add custom CSS classes to the <canvas> element
145
+ */
146
+ cssClasses: {
147
+ type: String,
148
+ default: undefined,
149
+ },
150
+ /**
151
+ * Add custom CSS styles to the <canvas> element
152
+ */
153
+ styles: {
154
+ type: Object as PropType<Partial<CSSStyleDeclaration>>,
155
+ default: () => {},
156
+ },
157
+ /**
158
+ * Value of the `plugins` key passed to the Chart config
159
+ */
160
+ plugins: {
161
+ type: Array as PropType<Plugin<'line'>[]>,
162
+ default: () => [],
163
+ },
164
+ });
165
+
166
+ const patternsColors = computed(() =>
167
+ lineDataProps.newPatternsOrder.length !== 6
168
+ ? colourSets[lineDataProps.colourSet]
169
+ : lineDataProps.newPatternsOrder.map((id) => {
170
+ return colourSets[lineDataProps.colourSet][id];
171
+ })
172
+ );
173
+
174
+ const patternsOrderedList =
175
+ lineDataProps.newPatternsOrder.length !== 6
176
+ ? patternsStandardList
177
+ : lineDataProps.newPatternsOrder.map((id) => {
178
+ return patternsStandardList[id];
179
+ });
180
+
181
+ const getTooltipData = (context: Context) => {
182
+ const datasetIndex = context.tooltip.dataPoints[0].datasetIndex as number;
183
+ const dataIndex = context.tooltip.dataPoints[0].dataIndex as number;
184
+ const formattedValue =
185
+ lineDataProps.lines[datasetIndex].data[dataIndex].toFixed(2);
186
+ return lineDataProps.lines[datasetIndex].unit
187
+ ? formattedValue + ' ' + lineDataProps.lines[datasetIndex].unit
188
+ : formattedValue;
189
+ };
190
+
191
+ const tooltipFirstLine = computed(() => {
192
+ return lineDataProps.tooltipFirstLineLabel;
193
+ });
194
+ const tooltipSecondLine = computed(() => {
195
+ return lineDataProps.tooltipSecondLineLabel;
196
+ });
197
+
198
+ const chartData = computed(() => {
199
+ return {
200
+ labels: lineDataProps.labels.map((label: string) => label),
201
+ datasets: [
202
+ {
203
+ type: 'line' as const,
204
+ borderColor: patternsColors.value[0],
205
+ pointStyle: 'rectRot',
206
+ pointBackgroundColor: '#FFFFFF',
207
+ pointRadius: 5,
208
+ label: lineDataProps.lines[0].label,
209
+ data: lineDataProps.lines[0].data,
210
+ borderWidth: 2,
211
+ },
212
+ {
213
+ type: 'line' as const,
214
+ borderColor: patternsColors.value[1],
215
+ pointStyle: 'circle',
216
+ pointBackgroundColor: '#FFFFFF',
217
+ pointRadius: 5,
218
+ label: lineDataProps.lines[1].label,
219
+ data: lineDataProps.lines[1].data,
220
+ borderWidth: 2,
221
+ },
222
+ ],
114
223
  };
115
-
116
- const tooltipFirstLine = 'months';
117
- const tooltipValueAttribute = computed(() => {
118
- return lineDataProps.rawTitle;
119
- });
120
-
121
- const chartData = computed(() => {
122
- return {
123
- labels: lineDataProps.labels.map((label: string) => label),
124
- datasets: [
125
- {
126
- type: 'line' as const,
127
- borderColor: '#605F9D',
128
- pointStyle: 'rectRot',
129
- pointBackgroundColor: '#FFFFFF',
130
- pointRadius: 5,
131
- label: lineDataProps.lines[0].label,
132
- data: lineDataProps.lines[0].data,
133
- borderWidth: 2
134
- },
135
- {
136
- type: 'line' as const,
137
- borderColor: '#00919F',
138
- pointStyle: 'circle',
139
- pointBackgroundColor: '#FFFFFF',
140
- pointRadius: 5,
141
- label: lineDataProps.lines[1].label,
142
- data: lineDataProps.lines[1].data,
143
- borderWidth: 2
144
- }
145
- ]
146
- };
147
- });
148
-
149
- function getHtmlLegendPlugin(legendContainer: Ref, selectMode: Ref) {
150
- return [{
224
+ });
225
+
226
+ function getHtmlLegendPlugin(legendContainer: Ref, selectMode: Ref) {
227
+ return [
228
+ {
151
229
  id: 'htmlLegend',
152
- afterUpdate (chart: any) {
230
+ afterUpdate(chart: any) {
153
231
  const ul = getOrCreateLegendList(legendContainer, 'column');
154
232
  ul.style.display = 'flex';
155
233
  ul.style.flexDirection = 'row';
234
+ ul.style.margin = '1.375rem 1.0625rem';
156
235
  while (ul.firstChild) {
157
236
  ul.firstChild.remove();
158
237
  }
159
238
  const items = chart.options.plugins.legend.labels.generateLabels(chart);
160
239
  items.forEach((item: ChartItem) => {
161
- const li = createHtmlLegendListElement(chart, selectMode, item.datasetIndex);
162
- let liContent: HTMLElement;
163
- if (!selectMode.value) {
164
- liContent = createLegendElementWithSquareArea(item);
165
- } else {
166
- liContent = createLegendElementWithCheckbox(chart, item);
167
- }
168
- li.style.marginRight = '10px';
169
- li.appendChild(liContent);
170
- li.appendChild(createHtmlLegendItemText(item));
171
- ul.appendChild(li);
240
+ const li = createHtmlLegendListElement(
241
+ chart,
242
+ selectMode,
243
+ item.datasetIndex
244
+ );
245
+ let liContent: HTMLElement;
246
+ if (!selectMode.value) {
247
+ liContent = createLegendElementWithSquareArea(item, null);
248
+ } else {
249
+ liContent = createLegendElementWithCheckbox(chart, item);
250
+ }
251
+ liContent.style.boxSizing = 'border-box';
252
+ li.style.marginRight = '10px';
253
+ li.appendChild(liContent);
254
+ li.appendChild(createHtmlLegendItemText(item));
255
+ ul.appendChild(li);
172
256
  });
173
- }
174
- }];
175
- }
257
+ },
258
+ },
259
+ ];
260
+ }
176
261
 
177
- function createLegendElementWithCheckbox (chart: any, item: ChartItem) {
262
+ function createLegendElementWithCheckbox(chart: any, item: ChartItem) {
178
263
  const liContent = createLegendCheckbox(chart, item);
179
264
  liContent.onclick = (e: Event) => {
180
265
  switchItemVisibility(chart, item.datasetIndex, selectMode);
@@ -182,64 +267,70 @@
182
267
  };
183
268
  return liContent;
184
269
  }
185
-
186
- const htmlLegendPlugin = getHtmlLegendPlugin(legendContainer, selectMode);
187
-
188
- const options = computed(() => ({
189
- responsive: true,
190
- maintainAspectRatio: true,
191
- plugins: {
192
- legend: {
193
- display: false
270
+
271
+ const htmlLegendPlugin = getHtmlLegendPlugin(legendContainer, selectMode);
272
+
273
+ const options = computed(() => ({
274
+ responsive: true,
275
+ maintainAspectRatio: false,
276
+ plugins: {
277
+ legend: {
278
+ display: false,
279
+ },
280
+ tooltip: {
281
+ enabled: false,
282
+ external: function (context: Context) {
283
+ new GenericTooltipService().createTooltip(
284
+ context,
285
+ getTooltipData,
286
+ {
287
+ chartType: TooltipChartType.LINE_CHART,
288
+ firstLineLabel: tooltipFirstLine.value,
289
+ secondLineLabel: tooltipSecondLine.value,
290
+ },
291
+ patternsColors.value,
292
+ patternsOrderedList,
293
+ lineDataProps.disableAccessibility
294
+ );
194
295
  },
195
- tooltip: {
196
- enabled: false,
197
- external: function (context: Context) {
198
- new GenericTooltipService().createTooltip(
199
- context,
200
- getTooltipData,
201
- {
202
- chartType: TooltipChartType.LINE_CHART,
203
- firstLineLabel: tooltipFirstLine,
204
- secondLineLabel: tooltipValueAttribute.value
205
- }
206
- );
207
- }
208
- }
209
296
  },
210
- scales: {
211
- y: {
212
- type: 'linear' as const,
213
- display: true,
214
- position: 'left' as const,
215
- grid: {
216
- drawOnChartArea: true
297
+ },
298
+ scales: {
299
+ x: {
300
+ offset: true,
301
+ },
302
+ y: {
303
+ type: 'linear' as const,
304
+ display: true,
305
+ position: 'left' as const,
306
+ grid: {
307
+ drawOnChartArea: true,
308
+ },
309
+ ticks: {
310
+ callback: function (val: number | string) {
311
+ const unit = lineDataProps.lines[0].unit;
312
+ return `${formatWithThousandsSeprators(val as number)} ${
313
+ unit ? unit : ''
314
+ }`;
217
315
  },
218
- ticks: {
219
- callback: function (val: number | string) {
220
- const unit = lineDataProps.lines[0].unit;
221
- return formatTicks(val as number, unit ? unit : null);
222
- },
223
- maxTicksLimit: 8,
224
- }
225
- }
226
- }
227
- }));
228
- </script>
229
-
230
- <style scoped>
231
- .container {
232
- -moz-osx-font-smoothing: grayscale;
233
- -webkit-font-smoothing: antialiased;
234
- font-weight: 400;
235
- font-family: 'Roboto', sans-serif;
236
- }
237
- .main {
238
- display: flex;
239
- flex-direction: column;
240
- justify-content: center;
241
- align-items: center;
242
- margin-bottom: 20px;
243
- }
244
- </style>
245
-
316
+ },
317
+ },
318
+ },
319
+ }));
320
+ </script>
321
+
322
+ <style scoped>
323
+ .container {
324
+ -moz-osx-font-smoothing: grayscale;
325
+ -webkit-font-smoothing: antialiased;
326
+ font-weight: 400;
327
+ font-family: 'Roboto', sans-serif;
328
+ }
329
+ .main {
330
+ display: flex;
331
+ flex-direction: column;
332
+ justify-content: center;
333
+ align-items: center;
334
+ margin-bottom: 20px;
335
+ }
336
+ </style>
@@ -0,0 +1,8 @@
1
+ import type { App } from "vue";
2
+ import LineChart from "./LineChart.vue";
3
+
4
+ LineChart.install = (app: App) => {
5
+ app.component("LineChart", LineChart);
6
+ };
7
+
8
+ export { LineChart };
@@ -0,0 +1,87 @@
1
+ // MixedBarLineChart.stories.ts
2
+
3
+ import type { Meta, StoryObj } from '@storybook/vue3';
4
+ import MixedBarLineChart from './MixedBarLineChart.vue';
5
+
6
+ const meta = {
7
+ title: 'Charts/MixedBarLine',
8
+ component: MixedBarLineChart,
9
+ } satisfies Meta<typeof MixedBarLineChart>;
10
+
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+
14
+ export const Default = {
15
+ args: {
16
+ width: '500px',
17
+ height: '400px',
18
+ tooltipFirstLineLabel: 'content',
19
+ tooltipSecondLineLabel: 'content2',
20
+ disableAccessibility: false,
21
+ newPatternsOrder: [0, 1, 0, 1, 2, 3],
22
+ colourSet: 0,
23
+ barDatasets: [
24
+ {
25
+ type: 'bar',
26
+ label: 'Bar Label 1',
27
+ data: [10, 20, 30, 40],
28
+ borderColor: 'rgb(255, 99, 132)',
29
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
30
+ },
31
+ ],
32
+ lineDatasets: [
33
+ {
34
+ type: 'line',
35
+ label: 'Line Label 1',
36
+ data: [5, 15, 20, 25],
37
+ borderColor: 'rgb(54, 162, 235)',
38
+ },
39
+ ],
40
+ labels: ['Label 1', 'Label 2', 'Label 3', 'Label 4'],
41
+ unit: '%',
42
+ },
43
+ } satisfies Story;
44
+
45
+ export const Multiple_Data = {
46
+ args: {
47
+ width: '500px',
48
+ height: '400px',
49
+ tooltipFirstLineLabel: 'content',
50
+ tooltipSecondLineLabel: 'content2',
51
+ disableAccessibility: false,
52
+ newPatternsOrder: [0, 1, 0, 1, 2, 3],
53
+ colourSet: 0,
54
+ barDatasets: [
55
+ {
56
+ type: 'bar',
57
+ label: 'Bar Label 1',
58
+ data: [10, 20, 30, 40],
59
+ borderColor: 'rgb(255, 99, 132)',
60
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
61
+ },
62
+ {
63
+ type: 'bar',
64
+ label: 'Bar Label 2',
65
+ data: [20, 20, 30, 40],
66
+ borderColor: 'rgb(255, 99, 132)',
67
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
68
+ },
69
+ ],
70
+ lineDatasets: [
71
+ {
72
+ type: 'line',
73
+ label: 'Line Label 1',
74
+ data: [5, 15, 20, 25],
75
+ borderColor: 'rgb(54, 162, 235)',
76
+ },
77
+ {
78
+ type: 'line',
79
+ label: 'Line Label 2',
80
+ data: [1, 8, 6, 24],
81
+ borderColor: 'rgb(54, 162, 235)',
82
+ },
83
+ ],
84
+ labels: ['Label 1', 'Label 2', 'Label 3', 'Label 4'],
85
+ unit: '%',
86
+ },
87
+ } satisfies Story;