@eturnity/eturnity_reusable_components 8.13.3-EPDM-14458.0 → 8.13.3-EPDM-14657.0
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/package.json +1 -1
- package/src/DemoCharts.vue +424 -0
- package/src/TestChart.vue +241 -0
- package/src/assets/svgIcons/refresh.svg +3 -0
- package/src/assets/theme.js +16 -0
- package/src/components/barchart/BottomFields.vue +253 -0
- package/src/components/barchart/ChartControls.vue +113 -0
- package/src/components/barchart/SelectionBox.vue +150 -0
- package/src/components/barchart/composables/index.js +5 -0
- package/src/components/barchart/composables/useAxisCalculations.js +104 -0
- package/src/components/barchart/composables/useChartData.js +114 -0
- package/src/components/barchart/composables/useChartScroll.js +61 -0
- package/src/components/barchart/composables/useSelection.js +75 -0
- package/src/components/barchart/composables/useTooltip.js +100 -0
- package/src/components/barchart/index.vue +376 -0
- package/src/components/barchart/styles/bottomFields.js +66 -0
- package/src/components/barchart/styles/chart.js +259 -0
- package/src/components/barchart/styles/chartControls.js +59 -0
- package/src/components/buttons/splitButtons/index.vue +86 -0
- package/src/components/collapsableInfoText/index.vue +2 -2
- package/src/components/inputs/inputNumber/index.vue +14 -2
- package/src/components/modals/modal/index.vue +1 -5
- package/src/helpers/isObjectEqual.js +22 -0
- package/src/main.js +8 -0
- package/src/router/dynamicRoutes.js +12 -0
package/package.json
CHANGED
@@ -0,0 +1,424 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="demo-container">
|
3
|
+
<h1>BarChart Component Examples</h1>
|
4
|
+
|
5
|
+
<h2>1. Basic Bar Chart</h2>
|
6
|
+
<BarChart
|
7
|
+
:data="basicData"
|
8
|
+
:value-formatter="kwhFormatter"
|
9
|
+
height="300px"
|
10
|
+
width="800px"
|
11
|
+
/>
|
12
|
+
|
13
|
+
<h2>2. Bar Chart with Custom Bar Width</h2>
|
14
|
+
<BarChart
|
15
|
+
:bar-width="80"
|
16
|
+
:data="basicData"
|
17
|
+
:value-formatter="kwhFormatter"
|
18
|
+
height="300px"
|
19
|
+
width="800px"
|
20
|
+
/>
|
21
|
+
|
22
|
+
<h2>3. Stacked Bar Chart - 3 Series with Legend</h2>
|
23
|
+
<BarChart
|
24
|
+
:bar-width="80"
|
25
|
+
:data="quarterLabels"
|
26
|
+
:is-legend-shown="true"
|
27
|
+
:series="threeZoneSeries"
|
28
|
+
:value-formatter="kwhFormatter"
|
29
|
+
height="400px"
|
30
|
+
width="800px"
|
31
|
+
/>
|
32
|
+
|
33
|
+
<h2>4. Stacked Bar Chart - 6 Series with Multi-Row Legend</h2>
|
34
|
+
<BarChart
|
35
|
+
:bar-width="60"
|
36
|
+
:data="monthLabels"
|
37
|
+
:is-legend-shown="true"
|
38
|
+
:legends-item-per-row="3"
|
39
|
+
:series="tariffZones"
|
40
|
+
:value-formatter="kwhFormatter"
|
41
|
+
height="400px"
|
42
|
+
width="800px"
|
43
|
+
/>
|
44
|
+
|
45
|
+
<h2>5. Scrollable Chart with Many Data Points</h2>
|
46
|
+
<BarChart
|
47
|
+
:bar-width="40"
|
48
|
+
:data="dailyData"
|
49
|
+
:is-scrollable="true"
|
50
|
+
:value-formatter="kwhFormatter"
|
51
|
+
height="300px"
|
52
|
+
width="800px"
|
53
|
+
/>
|
54
|
+
|
55
|
+
<h2>6. Scrollable Chart with Selection</h2>
|
56
|
+
<BarChart
|
57
|
+
:bar-width="40"
|
58
|
+
:data="dailyData"
|
59
|
+
:is-scrollable="true"
|
60
|
+
:is-selection-enabled="true"
|
61
|
+
:selection-size="5"
|
62
|
+
:value-formatter="kwhFormatter"
|
63
|
+
height="300px"
|
64
|
+
width="800px"
|
65
|
+
@selection-change="handleSelectionChange"
|
66
|
+
/>
|
67
|
+
|
68
|
+
<h2>7. Chart with Top Controls & Time Frame Selector</h2>
|
69
|
+
<BarChart
|
70
|
+
:bar-width="70"
|
71
|
+
:data="quarterLabels"
|
72
|
+
:is-legend-shown="true"
|
73
|
+
:selected-split-button="selectedTimeFrame"
|
74
|
+
:series="threeZoneSeries"
|
75
|
+
:split-button-options="timeFrameOptions"
|
76
|
+
:value-formatter="kwhFormatter"
|
77
|
+
chart-controls-position="top"
|
78
|
+
height="350px"
|
79
|
+
width="800px"
|
80
|
+
@select-split-button="handleTimeFrameSelect"
|
81
|
+
/>
|
82
|
+
|
83
|
+
<h2>8. Chart with Bottom Controls & Time Frame Selector</h2>
|
84
|
+
<BarChart
|
85
|
+
:bar-width="70"
|
86
|
+
:data="quarterLabels"
|
87
|
+
:is-legend-shown="true"
|
88
|
+
:selected-split-button="selectedTimeFrame"
|
89
|
+
:series="threeZoneSeries"
|
90
|
+
:split-button-options="timeFrameOptions"
|
91
|
+
:value-formatter="kwhFormatter"
|
92
|
+
chart-controls-position="bottom"
|
93
|
+
height="350px"
|
94
|
+
width="800px"
|
95
|
+
@select-split-button="handleTimeFrameSelect"
|
96
|
+
/>
|
97
|
+
|
98
|
+
<h2>9. Chart with Custom Tooltip</h2>
|
99
|
+
<BarChart :bar-width="60" :data="basicData" height="300px" width="800px">
|
100
|
+
<template #tooltip="{ item }">
|
101
|
+
<div style="padding: 8px">
|
102
|
+
<div style="font-weight: bold">{{ item.label }}</div>
|
103
|
+
<div>Consumption: {{ kwhFormatter(item.segments[0].value) }}</div>
|
104
|
+
<div>Peak Time: {{ getPeakTime(item.label) }}</div>
|
105
|
+
<div>Efficiency: {{ getEfficiency(item.segments[0].value) }}</div>
|
106
|
+
</div>
|
107
|
+
</template>
|
108
|
+
</BarChart>
|
109
|
+
|
110
|
+
<h2>10. Chart with Bottom Fields</h2>
|
111
|
+
<BarChart
|
112
|
+
:bar-width="60"
|
113
|
+
:data="basicData"
|
114
|
+
:is-bottom-fields-shown="true"
|
115
|
+
:value-formatter="kwhFormatter"
|
116
|
+
height="300px"
|
117
|
+
width="800px"
|
118
|
+
@update-value="handleValueUpdate"
|
119
|
+
/>
|
120
|
+
|
121
|
+
<h2>11. Scrollable Chart with Bottom Fields</h2>
|
122
|
+
<BarChart
|
123
|
+
:bar-width="40"
|
124
|
+
:data="monthlyData"
|
125
|
+
:is-bottom-fields-shown="true"
|
126
|
+
:is-scrollable="true"
|
127
|
+
:value-formatter="kwhFormatter"
|
128
|
+
height="300px"
|
129
|
+
width="800px"
|
130
|
+
/>
|
131
|
+
|
132
|
+
<h2>12. Stacked Chart with Bottom Fields</h2>
|
133
|
+
<BarChart
|
134
|
+
:bar-width="70"
|
135
|
+
:data="quarterLabels"
|
136
|
+
:is-bottom-fields-shown="true"
|
137
|
+
:is-legend-shown="true"
|
138
|
+
:series="threeZoneSeries"
|
139
|
+
:value-formatter="kwhFormatter"
|
140
|
+
height="400px"
|
141
|
+
width="800px"
|
142
|
+
/>
|
143
|
+
|
144
|
+
<h2>13. Scrollable Stacked Chart with Bottom Fields</h2>
|
145
|
+
<BarChart
|
146
|
+
:bar-width="60"
|
147
|
+
:data="monthLabels"
|
148
|
+
:is-bottom-fields-shown="true"
|
149
|
+
:is-legend-shown="true"
|
150
|
+
:is-scrollable="true"
|
151
|
+
:legends-item-per-row="3"
|
152
|
+
:series="tariffZones"
|
153
|
+
:value-formatter="kwhFormatter"
|
154
|
+
height="400px"
|
155
|
+
width="800px"
|
156
|
+
/>
|
157
|
+
|
158
|
+
<h2>14. Chart with Selection and Bottom Fields</h2>
|
159
|
+
<BarChart
|
160
|
+
:bar-width="40"
|
161
|
+
:data="monthlyData"
|
162
|
+
:is-bottom-fields-shown="true"
|
163
|
+
:is-scrollable="true"
|
164
|
+
:is-selection-enabled="true"
|
165
|
+
:selection-size="6"
|
166
|
+
:value-formatter="kwhFormatter"
|
167
|
+
height="350px"
|
168
|
+
width="800px"
|
169
|
+
@selection-change="handleSelectionChange"
|
170
|
+
/>
|
171
|
+
|
172
|
+
<h2>15. Stacked Chart and Bottom Fields</h2>
|
173
|
+
<BarChart
|
174
|
+
:bar-width="70"
|
175
|
+
:data="quarterLabels"
|
176
|
+
:is-bottom-fields-shown="true"
|
177
|
+
:is-legend-shown="true"
|
178
|
+
:series="threeZoneSeries"
|
179
|
+
:value-formatter="kwhFormatter"
|
180
|
+
height="400px"
|
181
|
+
width="800px"
|
182
|
+
@selection-change="handleSelectionChange"
|
183
|
+
/>
|
184
|
+
</div>
|
185
|
+
</template>
|
186
|
+
|
187
|
+
<script setup>
|
188
|
+
import { ref } from 'vue'
|
189
|
+
import BarChart from './components/barchart/index.vue'
|
190
|
+
|
191
|
+
// Formatters
|
192
|
+
const kwhFormatter = (value) => `${value.toLocaleString()} kWh`
|
193
|
+
|
194
|
+
// Basic data
|
195
|
+
const basicData = [
|
196
|
+
{ label: 'Jan', value: 1200 },
|
197
|
+
{ label: 'Feb', value: 1800 },
|
198
|
+
{ label: 'Mar', value: 2200 },
|
199
|
+
{ label: 'Apr', value: 1600 },
|
200
|
+
{ label: 'May', value: 2400 },
|
201
|
+
{ label: 'Jun', value: 2800 },
|
202
|
+
{ label: 'Jul', value: 2200 },
|
203
|
+
{ label: 'Aug', value: 1600 },
|
204
|
+
{ label: 'Sep', value: 2400 },
|
205
|
+
{ label: 'Oct', value: 2800 },
|
206
|
+
{ label: 'Nov', value: 2200 },
|
207
|
+
{ label: 'Dec', value: 1600 },
|
208
|
+
]
|
209
|
+
|
210
|
+
// Minimal data with fewer points
|
211
|
+
const minimalData = [
|
212
|
+
{ label: 'Q1', value: 3500 },
|
213
|
+
{ label: 'Q2', value: 4200 },
|
214
|
+
{ label: 'Q3', value: 5100 },
|
215
|
+
{ label: 'Q4', value: 4800 },
|
216
|
+
]
|
217
|
+
|
218
|
+
// Labels for stacked charts
|
219
|
+
const quarterLabels = [
|
220
|
+
{ label: 'Q1' },
|
221
|
+
{ label: 'Q2' },
|
222
|
+
{ label: 'Q3' },
|
223
|
+
{ label: 'Q4' },
|
224
|
+
]
|
225
|
+
|
226
|
+
const monthLabels = [
|
227
|
+
{ label: 'Jan' },
|
228
|
+
{ label: 'Feb' },
|
229
|
+
{ label: 'Mar' },
|
230
|
+
{ label: 'Apr' },
|
231
|
+
{ label: 'May' },
|
232
|
+
{ label: 'Jun' },
|
233
|
+
{ label: 'Jul' },
|
234
|
+
{ label: 'Aug' },
|
235
|
+
{ label: 'Sep' },
|
236
|
+
{ label: 'Oct' },
|
237
|
+
{ label: 'Nov' },
|
238
|
+
{ label: 'Dec' },
|
239
|
+
]
|
240
|
+
|
241
|
+
const monthlyData = [
|
242
|
+
{ label: 'Jan', value: 300 },
|
243
|
+
{ label: 'Feb', value: 600 },
|
244
|
+
{ label: 'Mar', value: 1000 },
|
245
|
+
{ label: 'Apr', value: 1200 },
|
246
|
+
{ label: 'May', value: 1400 },
|
247
|
+
{ label: 'Jun', value: 1810 },
|
248
|
+
{ label: 'Jul', value: 2000 },
|
249
|
+
{ label: 'Aug', value: 2200 },
|
250
|
+
{ label: 'Sep', value: 2400 },
|
251
|
+
{ label: 'Oct', value: 2600 },
|
252
|
+
{ label: 'Nov', value: 2800 },
|
253
|
+
{ label: 'Dec', value: 3000 },
|
254
|
+
{ label: 'Jan 2024', value: 2800 },
|
255
|
+
{ label: 'Feb 2024', value: 2600 },
|
256
|
+
{ label: 'Mar 2024', value: 2900 },
|
257
|
+
{ label: 'Apr 2024', value: 3100 },
|
258
|
+
{ label: 'May 2024', value: 2700 },
|
259
|
+
{ label: 'Jun 2024', value: 2500 },
|
260
|
+
]
|
261
|
+
|
262
|
+
// Three zone series data
|
263
|
+
const threeZoneSeries = [
|
264
|
+
{
|
265
|
+
name: 'Peak Hours',
|
266
|
+
data: [
|
267
|
+
{ label: 'Q1', value: 800 },
|
268
|
+
{ label: 'Q2', value: 1200 },
|
269
|
+
{ label: 'Q3', value: 1600 },
|
270
|
+
{ label: 'Q4', value: 1400 },
|
271
|
+
],
|
272
|
+
},
|
273
|
+
{
|
274
|
+
name: 'Mid-Peak',
|
275
|
+
data: [
|
276
|
+
{ label: 'Q1', value: 600 },
|
277
|
+
{ label: 'Q2', value: 800 },
|
278
|
+
{ label: 'Q3', value: 1000 },
|
279
|
+
{ label: 'Q4', value: 900 },
|
280
|
+
],
|
281
|
+
},
|
282
|
+
{
|
283
|
+
name: 'Off-Peak',
|
284
|
+
data: [
|
285
|
+
{ label: 'Q1', value: 400 },
|
286
|
+
{ label: 'Q2', value: 500 },
|
287
|
+
{ label: 'Q3', value: 600 },
|
288
|
+
{ label: 'Q4', value: 550 },
|
289
|
+
],
|
290
|
+
},
|
291
|
+
]
|
292
|
+
|
293
|
+
// Six zone series data
|
294
|
+
const tariffZones = [
|
295
|
+
{
|
296
|
+
name: 'Residential',
|
297
|
+
data: monthLabels.map(() => ({
|
298
|
+
label: 'Jan',
|
299
|
+
value: Math.floor(Math.random() * 300) + 100,
|
300
|
+
})),
|
301
|
+
},
|
302
|
+
{
|
303
|
+
name: 'Commercial',
|
304
|
+
data: monthLabels.map(() => ({
|
305
|
+
label: 'Jan',
|
306
|
+
value: Math.floor(Math.random() * 400) + 200,
|
307
|
+
})),
|
308
|
+
},
|
309
|
+
{
|
310
|
+
name: 'Industrial',
|
311
|
+
data: monthLabels.map(() => ({
|
312
|
+
label: 'Jan',
|
313
|
+
value: Math.floor(Math.random() * 500) + 300,
|
314
|
+
})),
|
315
|
+
},
|
316
|
+
{
|
317
|
+
name: 'Agricultural',
|
318
|
+
data: monthLabels.map(() => ({
|
319
|
+
label: 'Jan',
|
320
|
+
value: Math.floor(Math.random() * 200) + 100,
|
321
|
+
})),
|
322
|
+
},
|
323
|
+
{
|
324
|
+
name: 'Public',
|
325
|
+
data: monthLabels.map(() => ({
|
326
|
+
label: 'Jan',
|
327
|
+
value: Math.floor(Math.random() * 300) + 150,
|
328
|
+
})),
|
329
|
+
},
|
330
|
+
{
|
331
|
+
name: 'Special',
|
332
|
+
data: monthLabels.map(() => ({
|
333
|
+
label: 'Jan',
|
334
|
+
value: Math.floor(Math.random() * 250) + 100,
|
335
|
+
})),
|
336
|
+
},
|
337
|
+
].map((zone) => ({
|
338
|
+
...zone,
|
339
|
+
data: zone.data.map((item, index) => ({
|
340
|
+
...item,
|
341
|
+
label: monthLabels[index].label,
|
342
|
+
})),
|
343
|
+
}))
|
344
|
+
|
345
|
+
// Daily data for scrollable example
|
346
|
+
const dailyData = Array.from({ length: 31 }, (_, i) => ({
|
347
|
+
label: `Day ${i + 1}`,
|
348
|
+
value: Math.floor(Math.random() * 200) + 50,
|
349
|
+
}))
|
350
|
+
|
351
|
+
// Time frame options
|
352
|
+
const timeFrameOptions = [
|
353
|
+
{ label: 'Daily', value: 'daily' },
|
354
|
+
{ label: 'Weekly', value: 'weekly' },
|
355
|
+
{ label: 'Monthly', value: 'monthly' },
|
356
|
+
{ label: 'Yearly', value: 'yearly' },
|
357
|
+
]
|
358
|
+
const selectedTimeFrame = ref('monthly')
|
359
|
+
|
360
|
+
// View options
|
361
|
+
const viewOptions = [
|
362
|
+
{ label: 'Chart', value: 'chart' },
|
363
|
+
{ label: 'Table', value: 'table' },
|
364
|
+
{ label: 'Combined', value: 'combined' },
|
365
|
+
]
|
366
|
+
const selectedView = ref('chart')
|
367
|
+
|
368
|
+
// Handlers
|
369
|
+
const handleTimeFrameSelect = (value) => {
|
370
|
+
selectedTimeFrame.value = value
|
371
|
+
console.log(`Time frame changed to: ${value}`)
|
372
|
+
}
|
373
|
+
|
374
|
+
const handleViewSelect = (value) => {
|
375
|
+
selectedView.value = value
|
376
|
+
console.log(`View changed to: ${value}`)
|
377
|
+
}
|
378
|
+
|
379
|
+
const handleSelectionChange = (selection) => {
|
380
|
+
console.log('Selection changed:', selection)
|
381
|
+
}
|
382
|
+
|
383
|
+
const handleValueUpdate = (data) => {
|
384
|
+
console.log('Value updated:', data)
|
385
|
+
}
|
386
|
+
|
387
|
+
// Helper for custom tooltip
|
388
|
+
const getPeakTime = (month) => {
|
389
|
+
const peakTimes = {
|
390
|
+
Jan: '6-8 PM',
|
391
|
+
Feb: '5-7 PM',
|
392
|
+
Mar: '4-6 PM',
|
393
|
+
Apr: '3-5 PM',
|
394
|
+
May: '2-4 PM',
|
395
|
+
Jun: '1-3 PM',
|
396
|
+
}
|
397
|
+
return peakTimes[month] || 'N/A'
|
398
|
+
}
|
399
|
+
|
400
|
+
const getEfficiency = (value) => {
|
401
|
+
if (value < 1500) return 'High Efficiency'
|
402
|
+
if (value < 2500) return 'Medium Efficiency'
|
403
|
+
return 'Low Efficiency'
|
404
|
+
}
|
405
|
+
</script>
|
406
|
+
|
407
|
+
<style scoped>
|
408
|
+
.demo-container {
|
409
|
+
padding: 20px;
|
410
|
+
font-family: 'Figtree', sans-serif;
|
411
|
+
}
|
412
|
+
|
413
|
+
.demo-container > h2 {
|
414
|
+
margin: 40px 0 20px;
|
415
|
+
color: #333;
|
416
|
+
border-bottom: 1px solid #eee;
|
417
|
+
padding-bottom: 10px;
|
418
|
+
}
|
419
|
+
|
420
|
+
h1 {
|
421
|
+
color: #2c3e50;
|
422
|
+
margin-bottom: 30px;
|
423
|
+
}
|
424
|
+
</style>
|
@@ -0,0 +1,241 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
style="
|
4
|
+
margin-top: 100px;
|
5
|
+
margin-left: 80px;
|
6
|
+
padding-bottom: 100px;
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column-reverse;
|
9
|
+
"
|
10
|
+
>
|
11
|
+
<!-- Simple bar chart -->
|
12
|
+
<BarChart
|
13
|
+
:data="monthlyData"
|
14
|
+
width="700px"
|
15
|
+
height="400px"
|
16
|
+
:valueFormatter="valueFormatter"
|
17
|
+
:barWidth="60"
|
18
|
+
:isScrollable="false"
|
19
|
+
chartControlsPosition="bottom"
|
20
|
+
:isBottomFieldsShown="true"
|
21
|
+
:isSelectionEnabled="true"
|
22
|
+
:selectionSize="3"
|
23
|
+
@selection-change="handleSelectionChange"
|
24
|
+
>
|
25
|
+
</BarChart>
|
26
|
+
<br />
|
27
|
+
<br />
|
28
|
+
|
29
|
+
<!-- Stacked bar chart -->
|
30
|
+
<BarChart
|
31
|
+
yAxisTitle="Energy (kWh)"
|
32
|
+
:data="monthLabels"
|
33
|
+
:series="tariffZones"
|
34
|
+
width="700px"
|
35
|
+
height="400px"
|
36
|
+
:barWidth="60"
|
37
|
+
:valueFormatter="valueFormatter"
|
38
|
+
:legendsItemPerRow="4"
|
39
|
+
:splitButtonOptions="options"
|
40
|
+
:selectedSplitButton="selectedTimeFrame"
|
41
|
+
:isBottomFieldsShown="true"
|
42
|
+
:isLegendShown="true"
|
43
|
+
@select-split-button="handleSelectSplitButton"
|
44
|
+
@input-blur="handleInputBlur"
|
45
|
+
>
|
46
|
+
<!-- <template #tooltip="{ item, segment }">
|
47
|
+
<div style="display: flex; flex-direction: column">
|
48
|
+
{{ $c.log(item, segment) }}
|
49
|
+
<div>{{ item.label }}</div>
|
50
|
+
<div>{{ item.segments[0].value }} kWh</div>
|
51
|
+
</div>
|
52
|
+
</template> -->
|
53
|
+
</BarChart>
|
54
|
+
|
55
|
+
<!-- Stacked bar chart -->
|
56
|
+
<BarChart
|
57
|
+
yAxisTitle="Energy (kWh)"
|
58
|
+
:data="monthLabels"
|
59
|
+
:series="tariffZones"
|
60
|
+
width="700px"
|
61
|
+
height="400px"
|
62
|
+
:barWidth="60"
|
63
|
+
:valueFormatter="valueFormatter"
|
64
|
+
:legendsItemPerRow="4"
|
65
|
+
:isBottomFieldsShown="true"
|
66
|
+
:isLegendShown="false"
|
67
|
+
fieldMode="percentage"
|
68
|
+
@select-split-button="handleSelectSplitButton"
|
69
|
+
@input-blur="handleInputBlur"
|
70
|
+
>
|
71
|
+
<!-- <template #tooltip="{ item, segment }">
|
72
|
+
<div style="display: flex; flex-direction: column">
|
73
|
+
{{ $c.log(item, segment) }}
|
74
|
+
<div>{{ item.label }}</div>
|
75
|
+
<div>{{ item.segments[0].value }} kWh</div>
|
76
|
+
</div>
|
77
|
+
</template> -->
|
78
|
+
</BarChart>
|
79
|
+
</div>
|
80
|
+
</template>
|
81
|
+
|
82
|
+
<script setup>
|
83
|
+
import { ref } from 'vue'
|
84
|
+
import BarChart from '@/components/barchart/index.vue'
|
85
|
+
|
86
|
+
const options = [
|
87
|
+
{ label: 'Day', value: 'day' },
|
88
|
+
{ label: 'Month', value: 'month' },
|
89
|
+
{ label: 'Year', value: 'year' },
|
90
|
+
]
|
91
|
+
|
92
|
+
const selectedTimeFrame = ref('day')
|
93
|
+
|
94
|
+
const handleSelectSplitButton = (value) => {
|
95
|
+
selectedTimeFrame.value = value
|
96
|
+
}
|
97
|
+
|
98
|
+
const monthlyData = [
|
99
|
+
{ label: 'Jan', value: 300 },
|
100
|
+
{ label: 'Feb', value: 600 },
|
101
|
+
{ label: 'Mar', value: 1000 },
|
102
|
+
{ label: 'Apr', value: 1200 },
|
103
|
+
{ label: 'May', value: 1400 },
|
104
|
+
{ label: 'Jun', value: 1810 },
|
105
|
+
{ label: 'Jul', value: 1400 },
|
106
|
+
{ label: 'Aug', value: 1200 },
|
107
|
+
{ label: 'Sep', value: 1000 },
|
108
|
+
// { label: 'Oct', value: 800 },
|
109
|
+
// { label: 'Nov', value: 600 },
|
110
|
+
// { label: 'Dec', value: 400 },
|
111
|
+
// { label: 'Jan', value: 300 },
|
112
|
+
// { label: 'Feb', value: 600 },
|
113
|
+
// { label: 'Mar', value: 1000 },
|
114
|
+
// { label: 'Apr', value: 1200 },
|
115
|
+
// { label: 'May', value: 1400 },
|
116
|
+
// { label: 'Jun', value: 1810 },
|
117
|
+
// { label: 'Jul', value: 1400 },
|
118
|
+
// { label: 'Aug', value: 1200 },
|
119
|
+
// { label: 'Sep', value: 1000 },
|
120
|
+
// { label: 'Oct', value: 800 },
|
121
|
+
// { label: 'Nov', value: 600 },
|
122
|
+
// { label: 'Dec', value: 400 },
|
123
|
+
|
124
|
+
// ... more months
|
125
|
+
]
|
126
|
+
|
127
|
+
const monthLabels = [
|
128
|
+
{ label: 'Jan' },
|
129
|
+
{ label: 'Feb' },
|
130
|
+
{ label: 'Mar' },
|
131
|
+
{ label: 'Apr' },
|
132
|
+
{ label: 'May' },
|
133
|
+
{ label: 'Jun' },
|
134
|
+
// ... more months
|
135
|
+
]
|
136
|
+
|
137
|
+
const tariffZones = ref([
|
138
|
+
{
|
139
|
+
name: 'Tariff Zone 1',
|
140
|
+
data: [
|
141
|
+
{ label: 'Jan', value: 200 },
|
142
|
+
{ label: 'Feb', value: 130 },
|
143
|
+
{ label: 'Mar', value: 220 },
|
144
|
+
{ label: 'Apr', value: 230 },
|
145
|
+
{ label: 'May', value: 200 },
|
146
|
+
{ label: 'Jun', value: 210 },
|
147
|
+
// ... more months
|
148
|
+
],
|
149
|
+
},
|
150
|
+
{
|
151
|
+
name: 'Tariff Zone 2',
|
152
|
+
data: [
|
153
|
+
{ label: 'Jan', value: 200 },
|
154
|
+
{ label: 'Feb', value: 100 },
|
155
|
+
{ label: 'Mar', value: 270 },
|
156
|
+
{ label: 'Apr', value: 180 },
|
157
|
+
{ label: 'May', value: 300 },
|
158
|
+
{ label: 'Jun', value: 250 },
|
159
|
+
// ... more months
|
160
|
+
],
|
161
|
+
},
|
162
|
+
{
|
163
|
+
name: 'Tariff Zone 3',
|
164
|
+
data: [
|
165
|
+
{ label: 'Jan', value: 200 },
|
166
|
+
{ label: 'Feb', value: 100 },
|
167
|
+
{ label: 'Mar', value: 210 },
|
168
|
+
{ label: 'Apr', value: 220 },
|
169
|
+
{ label: 'May', value: 300 },
|
170
|
+
{ label: 'Jun', value: 190 },
|
171
|
+
// ... more months
|
172
|
+
],
|
173
|
+
},
|
174
|
+
{
|
175
|
+
name: 'Tariff Zone 4',
|
176
|
+
data: [
|
177
|
+
{ label: 'Jan', value: 200 },
|
178
|
+
{ label: 'Feb', value: 100 },
|
179
|
+
{ label: 'Mar', value: 210 },
|
180
|
+
{ label: 'Apr', value: 220 },
|
181
|
+
{ label: 'May', value: 300 },
|
182
|
+
{ label: 'Jun', value: 190 },
|
183
|
+
// ... more months
|
184
|
+
],
|
185
|
+
},
|
186
|
+
{
|
187
|
+
name: 'Tariff Zone 5',
|
188
|
+
data: [
|
189
|
+
{ label: 'Jan', value: 200 },
|
190
|
+
{ label: 'Feb', value: 100 },
|
191
|
+
{ label: 'Mar', value: 210 },
|
192
|
+
{ label: 'Apr', value: 220 },
|
193
|
+
{ label: 'May', value: 300 },
|
194
|
+
{ label: 'Jun', value: 190 },
|
195
|
+
// ... more months
|
196
|
+
],
|
197
|
+
},
|
198
|
+
{
|
199
|
+
name: 'Tariff Zone 6',
|
200
|
+
data: [
|
201
|
+
{ label: 'Jan', value: 200 },
|
202
|
+
{ label: 'Feb', value: 100 },
|
203
|
+
{ label: 'Mar', value: 210 },
|
204
|
+
{ label: 'Apr', value: 220 },
|
205
|
+
{ label: 'May', value: 300 },
|
206
|
+
{ label: 'Jun', value: 190 },
|
207
|
+
// ... more months
|
208
|
+
],
|
209
|
+
},
|
210
|
+
// ... more tariff zones
|
211
|
+
])
|
212
|
+
|
213
|
+
const valueFormatter = (value) => {
|
214
|
+
return `${value} kWh`
|
215
|
+
}
|
216
|
+
|
217
|
+
const handleSelectionChange = (selectedBars) => {
|
218
|
+
console.log('selectedBars', selectedBars)
|
219
|
+
}
|
220
|
+
|
221
|
+
const handleInputBlur = (payload) => {
|
222
|
+
console.log({ payload })
|
223
|
+
const newVal = [...tariffZones.value].map((zone) => {
|
224
|
+
if (zone.name === payload.seriesName) {
|
225
|
+
zone.data = zone.data.map((item) => {
|
226
|
+
if (item.label === payload.label) {
|
227
|
+
item.value = payload.value
|
228
|
+
}
|
229
|
+
return item
|
230
|
+
})
|
231
|
+
}
|
232
|
+
return zone
|
233
|
+
})
|
234
|
+
|
235
|
+
console.log({ newVal })
|
236
|
+
|
237
|
+
tariffZones.value = newVal
|
238
|
+
}
|
239
|
+
</script>
|
240
|
+
|
241
|
+
<style lang="scss" scoped></style>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path class="fix" d="M11.3335 12.5833C12.7477 11.5529 13.6668 9.88392 13.6668 8.00023C13.6668 4.87061 11.1298 2.33356 8.00016 2.33356H7.66683M8.00016 13.6669C4.87055 13.6669 2.3335 11.1298 2.3335 8.00023C2.3335 6.11654 3.25261 4.44751 4.66683 3.41716M7.3335 14.9336L8.66683 13.6002L7.3335 12.2669M8.66683 3.73356L7.3335 2.40023L8.66683 1.06689" stroke="#6F20DC" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
|
3
|
+
</svg>
|
package/src/assets/theme.js
CHANGED
@@ -179,9 +179,25 @@ const theme = (() => {
|
|
179
179
|
},
|
180
180
|
}
|
181
181
|
|
182
|
+
const chartGradients = {
|
183
|
+
simple: {
|
184
|
+
from: semanticColors.purple[500],
|
185
|
+
to: semanticColors.purple[400],
|
186
|
+
},
|
187
|
+
stacked: [
|
188
|
+
{ from: '#F5EDFF', to: '#DEC5FF' },
|
189
|
+
{ from: '#CAA2FF', to: '#F2E8FF' },
|
190
|
+
{ from: '#B987FC', to: '#904AEF' },
|
191
|
+
{ from: '#8B40F2', to: '#4A1394' },
|
192
|
+
{ from: '#6A05F2', to: '#4905A5' },
|
193
|
+
{ from: '#5402C3', to: '#2B0362' },
|
194
|
+
],
|
195
|
+
}
|
196
|
+
|
182
197
|
return {
|
183
198
|
colors,
|
184
199
|
semanticColors,
|
200
|
+
chartGradients,
|
185
201
|
fonts: {
|
186
202
|
mainFont: '"Figtree", sans-serif',
|
187
203
|
},
|