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