试验管理
This commit is contained in:
parent
b5f19577ec
commit
8a001ba290
|
|
@ -6,10 +6,12 @@
|
||||||
.one{
|
.one{
|
||||||
height: 4%;
|
height: 4%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
.one span{
|
.one span{
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
.two{
|
.two{
|
||||||
height: 40%;
|
height: 40%;
|
||||||
|
|
@ -65,7 +67,7 @@
|
||||||
}
|
}
|
||||||
.three-one div:nth-child(1){
|
.three-one div:nth-child(1){
|
||||||
margin-top: 1%;
|
margin-top: 1%;
|
||||||
margin-left: 2%;
|
margin-left: 20px;
|
||||||
height: 10%;
|
height: 10%;
|
||||||
}
|
}
|
||||||
.three-one div:nth-child(2){
|
.three-one div:nth-child(2){
|
||||||
|
|
@ -116,7 +118,7 @@
|
||||||
}
|
}
|
||||||
.four-one div{
|
.four-one div{
|
||||||
height: 58%;
|
height: 58%;
|
||||||
margin-left: 2%;
|
margin-left: 20px;
|
||||||
padding-top: 1%;
|
padding-top: 1%;
|
||||||
}
|
}
|
||||||
.four-one span{
|
.four-one span{
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,44 @@ function echartstwo(){
|
||||||
option = {
|
option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
trigger: 'item',
|
||||||
extraCssText: 'width:160px;height:100px;',
|
extraCssText: 'width:200px;height:100px;',
|
||||||
|
formatter: function (params) {
|
||||||
|
if (!params || !params.name || !params.value) {
|
||||||
|
return ''; // 如果数据无效,则返回空字符串
|
||||||
|
}
|
||||||
|
|
||||||
|
let text = ''; // 创建一个空字符串来存放最终的文本
|
||||||
|
|
||||||
|
// 处理参数数据
|
||||||
|
let name = params.name;
|
||||||
|
let value = params.value;
|
||||||
|
|
||||||
|
// 每行最多显示15个字符
|
||||||
|
const maxCharsPerLine = 8;
|
||||||
|
|
||||||
|
// 将名称分隔成多行
|
||||||
|
let lines = [];
|
||||||
|
while (name.length > maxCharsPerLine) {
|
||||||
|
let spaceIndex = name.lastIndexOf(' ', maxCharsPerLine);
|
||||||
|
if (spaceIndex === -1) {
|
||||||
|
spaceIndex = maxCharsPerLine;
|
||||||
|
}
|
||||||
|
lines.push(name.slice(0, spaceIndex));
|
||||||
|
name = name.slice(spaceIndex).trim();
|
||||||
|
}
|
||||||
|
lines.push(name);
|
||||||
|
|
||||||
|
// 将每一行添加到最终文本中,并在每行之间添加换行符
|
||||||
|
lines.forEach(function (line) {
|
||||||
|
text += line + '<br/>';
|
||||||
|
});
|
||||||
|
|
||||||
|
// 添加值
|
||||||
|
text += ': ' + value;
|
||||||
|
|
||||||
|
// 返回格式化的文本
|
||||||
|
return text;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// legend: {
|
// legend: {
|
||||||
// orient: 'vertical',
|
// orient: 'vertical',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue