* Fix echart tooltip display with too much items.

This commit is contained in:
qixinzhi
2023-09-26 05:30:27 +00:00
parent 88dcc3345b
commit 649d945605
2 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
.main .canvas {height: calc(100vh - 172px + 48px); max-height: 920px; overflow-y: hidden;}
.main .table-and-charts {height: calc(100vh - 172px); max-height: calc(100% - 48px); overflow-y: scroll;}
.main .metricBox {max-height: 408px;}
.chart-single {height: 100%; width: 100%;}
.chart-single {height: calc(100% - 32px); width: 100%;}
.chart-multiple {height: 328px; width: 100%;}
.chart-type {width: 30%; padding-left: 50px;}
+13 -3
View File
@@ -518,7 +518,7 @@ window.initChart = function($obj, head, data, chartType)
var seriesData = [];
xAxis.data.forEach(function(date) {
seriesData.push(dates.find(item => item.date === date) ? dates.find(item => item.date === date).value : null);
seriesData.push(dates.find(item => item.date === date) ? dates.find(item => item.date === date).value : 0);
});
series.push({data: seriesData, type: type, name: scope});
@@ -536,7 +536,16 @@ window.initChart = function($obj, head, data, chartType)
containLabel: true
},
tooltip: {
trigger: 'axis'
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
},
confine:true,//限制tooltip在图表范围内展示
extraCssText: 'max-height:60%;overflow-y:scroll',//最大高度以及超出处理
enterable:true//鼠标可以进入tooltip区域,使用滚动条
},
xAxis: chartType == 'barY' ? yAxis : xAxis,
yAxis: chartType == 'barY' ? xAxis : yAxis,
@@ -569,7 +578,8 @@ window.initPieChart = function($obj, head, data)
},
legend: {
orient: 'vertical',
left: 'left'
left: 'left',
type: 'scroll'
},
series: [
{