Commit eec20185 authored by 陈龙's avatar 陈龙

feat: 优化移动端显示

parent 78d1e6fa
...@@ -13,6 +13,17 @@ const COLOR = { ...@@ -13,6 +13,17 @@ const COLOR = {
LOWLOWER: '#FF0000', LOWLOWER: '#FF0000',
AVG: '#00B8B1', AVG: '#00B8B1',
}; };
const isMobile =() => {
const userAgent = navigator.userAgent.toLowerCase();
if (
/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(
userAgent
)
) {
return true;
}
return false;
}
/** /**
* 图表系列名称格式化 * 图表系列名称格式化
* *
...@@ -557,12 +568,13 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -557,12 +568,13 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}); });
tooltip = { tooltip = {
formatter: (e) => { formatter: (e) => {
debugger
return `<div> return `<div>
${headTemplate(e[0])} ${headTemplate(e[0])}
<div> <div>
<div style="display: flex; align-items: center;"> <div style="display: flex; align-items: center;">
<span>${ <span>${
e[0].seriesName isMobile()?'当前值':e[0].seriesName
}</span><span style="display:inline-block;">:</span> }</span><span style="display:inline-block;">:</span>
<span style="color: ${COLOR.NORMAL};margin: 0 5px 0 auto;">${ <span style="color: ${COLOR.NORMAL};margin: 0 5px 0 auto;">${
e[0]?.value?.[1] ?? '-' e[0]?.value?.[1] ?? '-'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment