res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[1]};\"></span>`} ${props.legendName[1]}:<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[1]};\"></span>`} ${props.legendName[1]}:<br>`;
}
}
return res;
return res;
} else {
} else {
res = params[0].axisValue + '<br>';
res = params[0].axisValue + '<br>';
res += `${params[0].marker} ${props.legendName}: ${params[0].value[1]} ${props.lineArray ? props.yName?.value[params[0].seriesIndex] : props.yName?.value}<br>`;
res += `${params[0].marker} ${props.legendName}: ${params[0].value} ${props.lineArray ? props.yName?.value[params[0].seriesIndex] : props.yName?.value}<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[0]};\"></span>`} ${props.legendName[0]}:<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[0]};\"></span>`} ${props.legendName[0]}:<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[1]};\"></span>`}${props.legendName[1]}:<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[1]};\"></span>`}${props.legendName[1]}:<br>`;
}
}
return res;
return res;
...
@@ -463,10 +463,10 @@ function initChart() {
...
@@ -463,10 +463,10 @@ function initChart() {
} else if (params[0].seriesIndex == 1) {
} else if (params[0].seriesIndex == 1) {
let res = timestampToHMS(params[0].axisValue) + '<br>';
let res = timestampToHMS(params[0].axisValue) + '<br>';
if(props.data[0].length>0){
if (props.data[0].length > 0) {
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[0]};\"></span>`}${props.legendName[0]}:<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[0]};\"></span>`}${props.legendName[0]}:<br>`;
}
}
if(props.data[1].length>0){
if (props.data[1].length > 0) {
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[1]};\"></span>`}${props.legendName[1]}:${params[0].value[1]}${props.lineArray?props.yName?.value[params[0].seriesIndex]:props.yName?.value}<br>`;
res += `${`<span style=\"display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${props.color[1]};\"></span>`}${props.legendName[1]}:${params[0].value[1]}${props.lineArray?props.yName?.value[params[0].seriesIndex]:props.yName?.value}<br>`;