Commit 6a5da773 authored by 陈龙's avatar 陈龙

feat: 优化显示

parent 26fbdcef
...@@ -33,7 +33,7 @@ const Demo = () => { ...@@ -33,7 +33,7 @@ const Demo = () => {
<HistoryView deviceParams={deviceParams} defaultModel="curve"/> <HistoryView deviceParams={deviceParams} defaultModel="curve"/>
</div> </div>
<div style={{height: 300}}> <div style={{height: 300}}>
<MobileHistoryChart deviceParams={deviceParams} chartType={'lineChart'}/> <MobileHistoryChart deviceParams={deviceParams} chartType={'boxChart'}/>
</div> </div>
</div> </div>
......
...@@ -40,14 +40,14 @@ const MobileHistoryChart = ( ...@@ -40,14 +40,14 @@ const MobileHistoryChart = (
date = { date = {
dateFrom: moment().format(`${DATE_FORMAT} 00:00:00`), dateFrom: moment().format(`${DATE_FORMAT} 00:00:00`),
dateTo: moment().format(`${DATE_FORMAT} 23:59:59`) dateTo: moment().format(`${DATE_FORMAT} 23:59:59`)
}, },// 默认当天
deviceParams = [], deviceParams = [], // 设备参数,必传
ignoreOutliers = true,
isDilute = true,
needMarkLine = true,
showBoxOption = true, //
chartGrid = true,
chartType='lineChart', // lineChart boxChart chartType='lineChart', // lineChart boxChart
ignoreOutliers = true, // 滤波
isDilute = true, // 抽稀去重
needMarkLine = true,
showBoxOption = true, // 开启箱线图配置,默认开启
chartGrid = true, // 开启网格
} }
) => { ) => {
const [deviceAlarmSchemes, setDeviceAlarmSchemes] = useState(null); const [deviceAlarmSchemes, setDeviceAlarmSchemes] = useState(null);
...@@ -57,7 +57,7 @@ const MobileHistoryChart = ( ...@@ -57,7 +57,7 @@ const MobileHistoryChart = (
const isBoxPlots = const isBoxPlots =
deviceParams?.length === 1 && deviceParams[0]?.sensors?.split(',').length === 1; deviceParams?.length === 1 && deviceParams[0]?.sensors?.split(',').length === 1;
const handleDataThinKey = (diffDays) => { const handleDataThinKey = (diffDays) => {
// 移动端缩放的抽稀一倍 // 移动端缩放的抽稀一倍,需要实际调试
if (diffDays >= 7 && diffDays < 15) { if (diffDays >= 7 && diffDays < 15) {
return {unit: 'h', zoom: '4'}; return {unit: 'h', zoom: '4'};
} else if (diffDays >= 15 && diffDays < 30) { } else if (diffDays >= 15 && diffDays < 30) {
...@@ -69,7 +69,7 @@ const MobileHistoryChart = ( ...@@ -69,7 +69,7 @@ const MobileHistoryChart = (
} else if (diffDays < 2 && diffDays >= 1) { } else if (diffDays < 2 && diffDays >= 1) {
return {unit: 'min', zoom: '60'}; return {unit: 'min', zoom: '60'};
} else { } else {
return {unit: 'min', zoom: '20'}; return {unit: 'min', zoom: '60'};
} }
}; };
......
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