onesight-charts 1.4.6 → 1.4.8
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/onesight-charts.min.js +1 -1
- package/es/components/common-bar/index.js +4 -4
- package/es/components/custom-line/index.js +2 -2
- package/es/components/line/index.js +1 -1
- package/es/components/one-table/index.js +1 -1
- package/es/components/pie/legend/index.js +2 -2
- package/es/components/stacked-bar/index.js +4 -4
- package/es/components/standard-custom-line/index.js +1 -1
- package/es/components/standard-line/index.js +2 -2
- package/es/components/vertical-stacked-bar/index.js +2 -2
- package/lib/components/common-bar/index.js +9 -4
- package/lib/components/custom-line/index.js +2 -2
- package/lib/components/line/index.js +1 -1
- package/lib/components/one-table/index.js +1 -1
- package/lib/components/pie/legend/index.js +2 -2
- package/lib/components/stacked-bar/index.js +4 -4
- package/lib/components/standard-custom-line/index.js +1 -1
- package/lib/components/standard-line/index.js +2 -2
- package/lib/components/vertical-stacked-bar/index.js +2 -2
- package/package.json +1 -1
|
@@ -420,9 +420,9 @@ function CommonBar(props) {
|
|
|
420
420
|
trigger: 'axis',
|
|
421
421
|
enterable: true,
|
|
422
422
|
padding: 0,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
showContent: true,
|
|
424
|
+
alwaysShowContent: true,
|
|
425
|
+
hideDelay: 1000000000,
|
|
426
426
|
position: function position(point, params, dom) {
|
|
427
427
|
var tooltipHeight = (dom === null || dom === void 0 ? void 0 : dom.offsetHeight) || 0;
|
|
428
428
|
var currentHeight = myDom.offsetHeight;
|
|
@@ -452,7 +452,7 @@ function CommonBar(props) {
|
|
|
452
452
|
var triangleWidth = 280;
|
|
453
453
|
var dataIndex = (_res$2 = res[1]) === null || _res$2 === void 0 ? void 0 : _res$2.dataIndex;
|
|
454
454
|
var originalItem = currentData[dataIndex];
|
|
455
|
-
return "<div class='onesight-chart-common-bar-tooltip-box' style=\"width:278px;position: relative;\">\n ".concat(isTooltipTitleShow ? "<div class=\"tooltip-head\">".concat(res[0].format || res[0].name, "</div>") : '', "\n ").concat(originalItem !== null && originalItem !== void 0 && originalItem.currentTime ? "<div class=\"tooltip-time\">".concat(originalItem === null || originalItem === void 0 ? void 0 : originalItem.currentTime, "</div>") : '', "\n <div class='tooltip-body'>\n ").concat(dataArr.map(function (item) {
|
|
455
|
+
return "<div class='onesight-chart-common-bar-tooltip-box' style=\"width:278px;position: relative;\">\n ".concat(isTooltipTitleShow ? "<div class=\"tooltip-head\" style=\"display: flex;align-items: center;\">\n ".concat(originalItem !== null && originalItem !== void 0 && originalItem.platformIcon ? "<span class=\"icon\" style=\"width: 16px !important;height: 16px !important;line-height: 1 !important;margin-right: 4px !important;margin-top: -2px !important;\">\n <img src=\"".concat(originalItem.platformIcon, "\" alt=\"\">\n </span>") : '', "\n <span>").concat(res[0].format || res[0].name, "</span>\n </div>") : '', "\n ").concat(originalItem !== null && originalItem !== void 0 && originalItem.currentTime ? "<div class=\"tooltip-time\">".concat(originalItem === null || originalItem === void 0 ? void 0 : originalItem.currentTime, "</div>") : '', "\n <div class='tooltip-body'>\n ").concat(dataArr.map(function (item) {
|
|
456
456
|
var _item$data;
|
|
457
457
|
var raw = (item === null || item === void 0 || (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.rawValue) !== undefined ? item.data.rawValue : item.value;
|
|
458
458
|
var itemWithAlias = _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -301,7 +301,7 @@ function CustomLine(props) {
|
|
|
301
301
|
},
|
|
302
302
|
// 给labelMark添加样式
|
|
303
303
|
labelMark: {
|
|
304
|
-
color: '#7A8283',
|
|
304
|
+
// color: '#7A8283',
|
|
305
305
|
fontSize: 12,
|
|
306
306
|
padding: [30, 0, 0, 0]
|
|
307
307
|
}
|
|
@@ -589,7 +589,7 @@ function CustomLine(props) {
|
|
|
589
589
|
}, 0)];
|
|
590
590
|
}));
|
|
591
591
|
var total = (_legendTotals$name = legendTotals[name]) !== null && _legendTotals$name !== void 0 ? _legendTotals$name : 0;
|
|
592
|
-
item.innerHTML = "\n <div class=\"l\">\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:
|
|
592
|
+
item.innerHTML = "\n <div class=\"l\">\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:16px;vertical-align:middle;height:4px;background-color:".concat(colorObj[name], ";margin-bottom:2px;margin-right:6px\"></span>\n <span>").concat(name, "</span>\n </div>\n <div class=\"r\" style=\"padding-left:6px;\">\n <span class=\"num\">").concat(numberFormatMust(total), "</span>\n </div>\n ");
|
|
593
593
|
item.onclick = function () {
|
|
594
594
|
var opt = myChart.getOption();
|
|
595
595
|
var legend = Array.isArray(opt.legend) ? opt.legend[0] : opt.legend;
|
|
@@ -143,8 +143,8 @@ function Legend(props) {
|
|
|
143
143
|
}), platformIconMap && platformIconMap[item.name] && /*#__PURE__*/React.createElement("img", {
|
|
144
144
|
src: platformIconMap[item.name],
|
|
145
145
|
style: {
|
|
146
|
-
width: '
|
|
147
|
-
height: '
|
|
146
|
+
width: '16px',
|
|
147
|
+
height: '16px',
|
|
148
148
|
marginRight: '6px',
|
|
149
149
|
flexShrink: 0,
|
|
150
150
|
verticalAlign: 'middle'
|
|
@@ -133,7 +133,7 @@ function StackedBar(props) {
|
|
|
133
133
|
var legendDataForCheck = series.map(function (s) {
|
|
134
134
|
return s.name;
|
|
135
135
|
});
|
|
136
|
-
var ICON_SIZE =
|
|
136
|
+
var ICON_SIZE = 16;
|
|
137
137
|
var ICON_GAP = 0;
|
|
138
138
|
var MAX_LABEL_WIDTH = 188;
|
|
139
139
|
|
|
@@ -527,7 +527,7 @@ function StackedBar(props) {
|
|
|
527
527
|
icon: 'roundRect',
|
|
528
528
|
itemWidth: 14,
|
|
529
529
|
itemHeight: 14,
|
|
530
|
-
itemGap:
|
|
530
|
+
itemGap: 8,
|
|
531
531
|
data: visibleLegends,
|
|
532
532
|
formatter: function formatter(name) {
|
|
533
533
|
var rawTotal = seriesTotalMap[name] || 0;
|
|
@@ -548,7 +548,7 @@ function StackedBar(props) {
|
|
|
548
548
|
},
|
|
549
549
|
// 给labelMark添加样式
|
|
550
550
|
labelMark: {
|
|
551
|
-
color: '#7A8283',
|
|
551
|
+
// color: '#7A8283',
|
|
552
552
|
fontSize: 12,
|
|
553
553
|
padding: [30, 0, 0, 0]
|
|
554
554
|
}
|
|
@@ -813,7 +813,7 @@ function StackedBar(props) {
|
|
|
813
813
|
cursor: 'pointer'
|
|
814
814
|
});
|
|
815
815
|
var total = (_seriesTotalMap$name = seriesTotalMap[name]) !== null && _seriesTotalMap$name !== void 0 ? _seriesTotalMap$name : 0;
|
|
816
|
-
item.innerHTML = "\n <div class=\"l\">\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:
|
|
816
|
+
item.innerHTML = "\n <div class=\"l\">\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:16px;vertical-align:middle;height:4px;background-color:".concat(colorObj[name], ";margin-right:6px;flex-shrink:0;\"></span>\n <span style=\"flex:1;min-width:0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;\">").concat(name, "</span>\n </div>\n <div class=\"r\">\n <span class=\"num\">").concat(numberFormatMust(total), "</span>\n </div>\n ");
|
|
817
817
|
item.onclick = function () {
|
|
818
818
|
var opt = myChart.getOption();
|
|
819
819
|
var legend = Array.isArray(opt.legend) ? opt.legend[0] : opt.legend;
|
|
@@ -315,7 +315,7 @@ function StandardLine(props) {
|
|
|
315
315
|
},
|
|
316
316
|
// 给labelMark添加样式
|
|
317
317
|
labelMark: {
|
|
318
|
-
color: '#7A8283',
|
|
318
|
+
// color: '#7A8283',
|
|
319
319
|
fontSize: 12,
|
|
320
320
|
padding: [30, 0, 0, 0]
|
|
321
321
|
}
|
|
@@ -620,7 +620,7 @@ function StandardLine(props) {
|
|
|
620
620
|
} else if (sumData) {
|
|
621
621
|
total = sumData;
|
|
622
622
|
}
|
|
623
|
-
item.innerHTML = "\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:
|
|
623
|
+
item.innerHTML = "\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:16px;height:4px;background-color:".concat(colorObj[name], ";flex-shrink:0;margin-right:6px\"></span>\n <span class=\"onesight-legend-name\" style=\"flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap\">").concat(name, "</span>\n <span class=\"onesight-legend-num\" style=\"flex-shrink:0;padding-left:6px\">").concat(numberFormatMust(total), "</span>\n ");
|
|
624
624
|
item.onclick = function () {
|
|
625
625
|
var opt = myChart.getOption();
|
|
626
626
|
var legend = Array.isArray(opt.legend) ? opt.legend[0] : opt.legend;
|
|
@@ -577,7 +577,7 @@ function VerticalStackedBar(props) {
|
|
|
577
577
|
icon: 'roundRect',
|
|
578
578
|
itemWidth: 14,
|
|
579
579
|
itemHeight: 14,
|
|
580
|
-
itemGap:
|
|
580
|
+
itemGap: 8,
|
|
581
581
|
formatter: function formatter(name) {
|
|
582
582
|
var _legendTotals$name;
|
|
583
583
|
// name 是 uniqueKey,需要转换为原始 name 用于显示
|
|
@@ -805,7 +805,7 @@ function VerticalStackedBar(props) {
|
|
|
805
805
|
// 检查是否有 platformIcon
|
|
806
806
|
var platformIcon = platformIconMap[uniqueKey];
|
|
807
807
|
var iconHtml = platformIcon ? "<img src=\"".concat(platformIcon, "\" style=\"width:13px;height:13px;margin-right:6px;flex-shrink:0;vertical-align:middle;\" alt=\"\" />") : '';
|
|
808
|
-
item.innerHTML = "\n <div class=\"l\">\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:
|
|
808
|
+
item.innerHTML = "\n <div class=\"l\">\n <span class=\"onesight-legend-chip\" style=\"display:inline-block;width:16px;vertical-align:middle;height:4px;background-color:".concat(colorObj[uniqueKey], ";margin-right:6px;flex-shrink:0;\"></span>\n ").concat(iconHtml, "\n <span style=\"flex:1;min-width:0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;\">").concat(originalName, "</span>\n </div>\n <div class=\"r\">\n <span class=\"num\">").concat(changeDataTypeEn(total), "</span>\n </div>\n ");
|
|
809
809
|
item.onclick = function () {
|
|
810
810
|
var opt = myChart.getOption();
|
|
811
811
|
var legend = Array.isArray(opt.legend) ? opt.legend[0] : opt.legend;
|
|
@@ -392,9 +392,9 @@ function CommonBar(props) {
|
|
|
392
392
|
trigger: "axis",
|
|
393
393
|
enterable: true,
|
|
394
394
|
padding: 0,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
395
|
+
showContent: true,
|
|
396
|
+
alwaysShowContent: true,
|
|
397
|
+
hideDelay: 1e9,
|
|
398
398
|
position: (point, params, dom) => {
|
|
399
399
|
const tooltipHeight = (dom == null ? void 0 : dom.offsetHeight) || 0;
|
|
400
400
|
const currentHeight = myDom.offsetHeight;
|
|
@@ -422,7 +422,12 @@ function CommonBar(props) {
|
|
|
422
422
|
const dataIndex = (_b = res[1]) == null ? void 0 : _b.dataIndex;
|
|
423
423
|
const originalItem = currentData[dataIndex];
|
|
424
424
|
return `<div class='onesight-chart-common-bar-tooltip-box' style="width:278px;position: relative;">
|
|
425
|
-
${isTooltipTitleShow ? `<div class="tooltip-head"
|
|
425
|
+
${isTooltipTitleShow ? `<div class="tooltip-head" style="display: flex;align-items: center;">
|
|
426
|
+
${(originalItem == null ? void 0 : originalItem.platformIcon) ? `<span class="icon" style="width: 16px !important;height: 16px !important;line-height: 1 !important;margin-right: 4px !important;margin-top: -2px !important;">
|
|
427
|
+
<img src="${originalItem.platformIcon}" alt="">
|
|
428
|
+
</span>` : ""}
|
|
429
|
+
<span>${res[0].format || res[0].name}</span>
|
|
430
|
+
</div>` : ""}
|
|
426
431
|
${(originalItem == null ? void 0 : originalItem.currentTime) ? `<div class="tooltip-time">${originalItem == null ? void 0 : originalItem.currentTime}</div>` : ""}
|
|
427
432
|
<div class='tooltip-body'>
|
|
428
433
|
${dataArr.map((item) => {
|
|
@@ -284,7 +284,7 @@ function CustomLine(props) {
|
|
|
284
284
|
},
|
|
285
285
|
// 给labelMark添加样式
|
|
286
286
|
labelMark: {
|
|
287
|
-
color:
|
|
287
|
+
// color: '#7A8283',
|
|
288
288
|
fontSize: 12,
|
|
289
289
|
padding: [30, 0, 0, 0]
|
|
290
290
|
}
|
|
@@ -543,7 +543,7 @@ function CustomLine(props) {
|
|
|
543
543
|
const total = legendTotals[name] ?? 0;
|
|
544
544
|
item.innerHTML = `
|
|
545
545
|
<div class="l">
|
|
546
|
-
<span class="onesight-legend-chip" style="display:inline-block;width:
|
|
546
|
+
<span class="onesight-legend-chip" style="display:inline-block;width:16px;vertical-align:middle;height:4px;background-color:${colorObj[name]};margin-bottom:2px;margin-right:6px"></span>
|
|
547
547
|
<span>${name}</span>
|
|
548
548
|
</div>
|
|
549
549
|
<div class="r" style="padding-left:6px;">
|
|
@@ -136,7 +136,7 @@ function StackedBar(props) {
|
|
|
136
136
|
}, [onChartClick]);
|
|
137
137
|
const chartColor = color || import_colors.defaultChartColors;
|
|
138
138
|
const legendDataForCheck = series.map((s) => s.name);
|
|
139
|
-
const ICON_SIZE =
|
|
139
|
+
const ICON_SIZE = 16;
|
|
140
140
|
const ICON_GAP = 0;
|
|
141
141
|
const MAX_LABEL_WIDTH = 188;
|
|
142
142
|
function makeYAxisRich(rows, maxLabelWidth = 188) {
|
|
@@ -497,7 +497,7 @@ function StackedBar(props) {
|
|
|
497
497
|
icon: "roundRect",
|
|
498
498
|
itemWidth: 14,
|
|
499
499
|
itemHeight: 14,
|
|
500
|
-
itemGap:
|
|
500
|
+
itemGap: 8,
|
|
501
501
|
data: visibleLegends,
|
|
502
502
|
formatter: function(name) {
|
|
503
503
|
const rawTotal = seriesTotalMap[name] || 0;
|
|
@@ -519,7 +519,7 @@ function StackedBar(props) {
|
|
|
519
519
|
},
|
|
520
520
|
// 给labelMark添加样式
|
|
521
521
|
labelMark: {
|
|
522
|
-
color:
|
|
522
|
+
// color: '#7A8283',
|
|
523
523
|
fontSize: 12,
|
|
524
524
|
padding: [30, 0, 0, 0]
|
|
525
525
|
}
|
|
@@ -739,7 +739,7 @@ function StackedBar(props) {
|
|
|
739
739
|
const total = seriesTotalMap[name] ?? 0;
|
|
740
740
|
item.innerHTML = `
|
|
741
741
|
<div class="l">
|
|
742
|
-
<span class="onesight-legend-chip" style="display:inline-block;width:
|
|
742
|
+
<span class="onesight-legend-chip" style="display:inline-block;width:16px;vertical-align:middle;height:4px;background-color:${colorObj[name]};margin-right:6px;flex-shrink:0;"></span>
|
|
743
743
|
<span style="flex:1;min-width:0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">${name}</span>
|
|
744
744
|
</div>
|
|
745
745
|
<div class="r">
|
|
@@ -298,7 +298,7 @@ function StandardLine(props) {
|
|
|
298
298
|
},
|
|
299
299
|
// 给labelMark添加样式
|
|
300
300
|
labelMark: {
|
|
301
|
-
color:
|
|
301
|
+
// color: '#7A8283',
|
|
302
302
|
fontSize: 12,
|
|
303
303
|
padding: [30, 0, 0, 0]
|
|
304
304
|
}
|
|
@@ -569,7 +569,7 @@ function StandardLine(props) {
|
|
|
569
569
|
total = sumData;
|
|
570
570
|
}
|
|
571
571
|
item.innerHTML = `
|
|
572
|
-
<span class="onesight-legend-chip" style="display:inline-block;width:
|
|
572
|
+
<span class="onesight-legend-chip" style="display:inline-block;width:16px;height:4px;background-color:${colorObj[name]};flex-shrink:0;margin-right:6px"></span>
|
|
573
573
|
<span class="onesight-legend-name" style="flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${name}</span>
|
|
574
574
|
<span class="onesight-legend-num" style="flex-shrink:0;padding-left:6px">${(0, import_chartUtils.numberFormatMust)(
|
|
575
575
|
total
|
|
@@ -545,7 +545,7 @@ function VerticalStackedBar(props) {
|
|
|
545
545
|
icon: "roundRect",
|
|
546
546
|
itemWidth: 14,
|
|
547
547
|
itemHeight: 14,
|
|
548
|
-
itemGap:
|
|
548
|
+
itemGap: 8,
|
|
549
549
|
formatter: function(name) {
|
|
550
550
|
const originalName = keyToNameMap && keyToNameMap[name] ? keyToNameMap[name] : name;
|
|
551
551
|
let showName = originalName;
|
|
@@ -742,7 +742,7 @@ function VerticalStackedBar(props) {
|
|
|
742
742
|
const iconHtml = platformIcon ? `<img src="${platformIcon}" style="width:13px;height:13px;margin-right:6px;flex-shrink:0;vertical-align:middle;" alt="" />` : "";
|
|
743
743
|
item.innerHTML = `
|
|
744
744
|
<div class="l">
|
|
745
|
-
<span class="onesight-legend-chip" style="display:inline-block;width:
|
|
745
|
+
<span class="onesight-legend-chip" style="display:inline-block;width:16px;vertical-align:middle;height:4px;background-color:${colorObj[uniqueKey]};margin-right:6px;flex-shrink:0;"></span>
|
|
746
746
|
${iconHtml}
|
|
747
747
|
<span style="flex:1;min-width:0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">${originalName}</span>
|
|
748
748
|
</div>
|