evui 3.1.43 → 3.1.47
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/evui.common.js +90 -70
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +90 -70
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/Chart.vue +1 -1
- package/src/components/chart/chart.core.js +1 -1
- package/src/components/chart/element/element.bar.js +4 -2
- package/src/components/chart/helpers/helpers.canvas.js +3 -3
- package/src/components/chart/model/model.store.js +18 -7
- package/src/components/datePicker/uses.js +13 -7
package/package.json
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
|
|
86
86
|
await watch(() => props.data, (chartData) => {
|
|
87
87
|
const newData = getNormalizedData(chartData);
|
|
88
|
-
const isUpdateSeries = !isEqual(newData
|
|
88
|
+
const isUpdateSeries = !isEqual(newData, evChart.data);
|
|
89
89
|
evChart.data = cloneDeep(newData);
|
|
90
90
|
evChart.update({
|
|
91
91
|
updateSeries: isUpdateSeries,
|
|
@@ -520,7 +520,7 @@ class EvChart {
|
|
|
520
520
|
this.seriesList = {};
|
|
521
521
|
this.lastTip = { pos: null, value: null };
|
|
522
522
|
|
|
523
|
-
this.createSeriesSet(series, options.type);
|
|
523
|
+
this.createSeriesSet(series, options.type, options.horizontal);
|
|
524
524
|
|
|
525
525
|
if (this.legendDOM) {
|
|
526
526
|
this.resetLegend();
|
|
@@ -151,6 +151,7 @@ class Bar {
|
|
|
151
151
|
this.drawBar({
|
|
152
152
|
ctx,
|
|
153
153
|
positions: { x, y, w, h },
|
|
154
|
+
isTop: item.isTop,
|
|
154
155
|
});
|
|
155
156
|
|
|
156
157
|
if (showValue.use) {
|
|
@@ -212,6 +213,7 @@ class Bar {
|
|
|
212
213
|
this.drawBar({
|
|
213
214
|
ctx,
|
|
214
215
|
positions: { x, y, w, h: this.isHorizontal ? -h : h },
|
|
216
|
+
isTop: item.data.isTop,
|
|
215
217
|
});
|
|
216
218
|
|
|
217
219
|
if (showValue.use) {
|
|
@@ -409,7 +411,7 @@ class Bar {
|
|
|
409
411
|
ctx.restore();
|
|
410
412
|
}
|
|
411
413
|
|
|
412
|
-
drawBar({ ctx, positions }) {
|
|
414
|
+
drawBar({ ctx, positions, isTop }) {
|
|
413
415
|
const isHorizontal = this.isHorizontal;
|
|
414
416
|
const isStackBar = 'stackIndex' in this;
|
|
415
417
|
const isBorderRadius = this.borderRadius && this.borderRadius > 0;
|
|
@@ -421,7 +423,7 @@ class Bar {
|
|
|
421
423
|
return;
|
|
422
424
|
}
|
|
423
425
|
|
|
424
|
-
if (isBorderRadius &&
|
|
426
|
+
if ((!isStackBar && isBorderRadius) || (isStackBar && isBorderRadius && isTop)) {
|
|
425
427
|
try {
|
|
426
428
|
this.drawRoundedRect(ctx, positions);
|
|
427
429
|
} catch (e) {
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
* @returns {any} position
|
|
13
13
|
*/
|
|
14
14
|
calculateX(value, min, max, area, startPoint = 0) {
|
|
15
|
-
if (value === null) {
|
|
15
|
+
if (value === null || value === undefined) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
* @returns {any} position
|
|
36
36
|
*/
|
|
37
37
|
calculateSubX(value, min, max, area, startPoint = 0) {
|
|
38
|
-
if (value === null) {
|
|
38
|
+
if (value === null || value === undefined) {
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
calculateY(value, min, max, area, startPoint = 0) {
|
|
57
57
|
let calcY;
|
|
58
58
|
|
|
59
|
-
if (value === null) {
|
|
59
|
+
if (value === null || value === undefined) {
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -26,7 +26,7 @@ const modules = {
|
|
|
26
26
|
|
|
27
27
|
if (series && sData) {
|
|
28
28
|
if (series.isExistGrp && series.stackIndex) {
|
|
29
|
-
series.data = this.addSeriesStackDS(sData, label, series
|
|
29
|
+
series.data = this.addSeriesStackDS(sData, label, series);
|
|
30
30
|
} else {
|
|
31
31
|
series.data = this.addSeriesDS(sData, label);
|
|
32
32
|
}
|
|
@@ -173,12 +173,12 @@ const modules = {
|
|
|
173
173
|
* Take data and label to create stack data for each series
|
|
174
174
|
* @param {object} data chart series info
|
|
175
175
|
* @param {object} label chart label
|
|
176
|
-
* @param {
|
|
177
|
-
* @param {number} sIdx series ordered index
|
|
176
|
+
* @param {object} series series Information
|
|
178
177
|
*
|
|
179
178
|
* @returns {array} data for each series
|
|
180
179
|
*/
|
|
181
|
-
addSeriesStackDS(data, label,
|
|
180
|
+
addSeriesStackDS(data, label, series) {
|
|
181
|
+
const bsIds = series.bsIds; // stacked base data ID List
|
|
182
182
|
const isHorizontal = this.options.horizontal;
|
|
183
183
|
const sdata = [];
|
|
184
184
|
|
|
@@ -201,6 +201,8 @@ const modules = {
|
|
|
201
201
|
};
|
|
202
202
|
|
|
203
203
|
data.forEach((curr, index) => {
|
|
204
|
+
const { stackIndex, show: isShowSeries } = series;
|
|
205
|
+
const isTop = true; // is top position on stack (Stacked or not, default is true)
|
|
204
206
|
const baseIndex = bsIds.length - 1 < 0 ? 0 : bsIds.length - 1;
|
|
205
207
|
let bdata = getBaseDataPosition(baseIndex, index); // base(previous) series data
|
|
206
208
|
let odata = curr; // current series original data
|
|
@@ -214,7 +216,7 @@ const modules = {
|
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
const oData = odata?.value ?? odata;
|
|
217
|
-
if (
|
|
219
|
+
if (stackIndex > 0) {
|
|
218
220
|
if (oData != null) {
|
|
219
221
|
gdata = bdata + oData;
|
|
220
222
|
} else {
|
|
@@ -226,7 +228,14 @@ const modules = {
|
|
|
226
228
|
gdata = oData;
|
|
227
229
|
}
|
|
228
230
|
|
|
229
|
-
|
|
231
|
+
if (gdata && isShowSeries) {
|
|
232
|
+
for (let idx = baseIndex; idx > -1; idx--) {
|
|
233
|
+
const prevSeriesData = this.seriesList[bsIds[idx]];
|
|
234
|
+
prevSeriesData.data[index].isTop = false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
sdata.push(this.addData(gdata, ldata, odata, bdata, isTop));
|
|
230
239
|
}
|
|
231
240
|
});
|
|
232
241
|
|
|
@@ -267,10 +276,11 @@ const modules = {
|
|
|
267
276
|
* @param {object} ldata label data (x-axis value for vertical chart)
|
|
268
277
|
* @param {object} odata original data (without stacked value)
|
|
269
278
|
* @param {object} bdata base data (stacked value)
|
|
279
|
+
* @param {boolean} isTop is top position on stack (Stacked or not, default is true)
|
|
270
280
|
|
|
271
281
|
* @returns {object} data for each graph point
|
|
272
282
|
*/
|
|
273
|
-
addData(gdata, ldata, odata = null, bdata = null) {
|
|
283
|
+
addData(gdata, ldata, odata = null, bdata = null, isTop = true) {
|
|
274
284
|
let data;
|
|
275
285
|
const gdataValue = gdata?.value ?? gdata;
|
|
276
286
|
const odataValue = odata?.value ?? odata;
|
|
@@ -287,6 +297,7 @@ const modules = {
|
|
|
287
297
|
data.w = null;
|
|
288
298
|
data.h = null;
|
|
289
299
|
data.dataColor = dataColor || null;
|
|
300
|
+
data.isTop = isTop;
|
|
290
301
|
|
|
291
302
|
return data;
|
|
292
303
|
},
|
|
@@ -333,16 +333,21 @@ export const useShortcuts = (param) => {
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
const shortcutDate = targetShortcut.shortcutDate;
|
|
336
|
+
const timeFormat = props.options?.timeFormat;
|
|
336
337
|
|
|
337
338
|
if (isRange) {
|
|
338
339
|
const [fromDate, toDate] = shortcutDate();
|
|
339
340
|
if (props.mode === 'dateTimeRange') {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
341
|
+
if (timeFormat?.length) {
|
|
342
|
+
const [fromTimeFormat, toTimeFormat] = timeFormat;
|
|
343
|
+
|
|
344
|
+
mv.value = [
|
|
345
|
+
getChangedValueByTimeFormat(fromTimeFormat, formatDateTime(fromDate)),
|
|
346
|
+
getChangedValueByTimeFormat(toTimeFormat, formatDateTime(toDate)),
|
|
347
|
+
];
|
|
348
|
+
} else {
|
|
349
|
+
mv.value = [formatDateTime(fromDate), formatDateTime(toDate)];
|
|
350
|
+
}
|
|
346
351
|
} else {
|
|
347
352
|
mv.value = [formatDate(fromDate), formatDate(toDate)];
|
|
348
353
|
}
|
|
@@ -350,12 +355,13 @@ export const useShortcuts = (param) => {
|
|
|
350
355
|
const sDate = shortcutDate();
|
|
351
356
|
mv.value = props.mode === 'dateTime'
|
|
352
357
|
? getChangedValueByTimeFormat(
|
|
353
|
-
|
|
358
|
+
timeFormat,
|
|
354
359
|
formatDateTime(sDate))
|
|
355
360
|
: formatDate(sDate);
|
|
356
361
|
}
|
|
357
362
|
|
|
358
363
|
clearShortcuts();
|
|
364
|
+
activeShortcut(targetKey);
|
|
359
365
|
};
|
|
360
366
|
|
|
361
367
|
watch(
|