Commit 05541f08 authored by 陈龙's avatar 陈龙

feat: 优化历史曲线显示

parent bb66166f
......@@ -30,7 +30,7 @@ path: /
## 多图表
<!-- <code src="./demos/GridDemo.js"></code> -->
<code src="./demos/GridDemo.js"></code>
## API
......
......@@ -63,7 +63,7 @@ const deviceParams = [
"sensors": "瞬时流量",
"deviceType": "水厂"
},
{
/* {
"deviceCode": "JFJ00000001",
"sensors": "沉淀池投矾量瞬时,",
"deviceType": "加矾间"
......@@ -88,12 +88,12 @@ const deviceParams = [
"sensors": "瞬时流量",
"deviceType": "流量计"
},
/*邳州*/
/!*邳州*!/
{
deviceCode: 'EGJZ00000027',
sensors: '2#变频器运行频率',
deviceType: '二供机组',
},
},*/
/*确山*/
/*泵3状态*/
/* {
......
......@@ -634,9 +634,9 @@ const handleDefault = (config, cusOption) => {
};
};
const handleMaxValue = (value) => {
if (value <= 1) return value;
if (value >= 10000) return `${(value / 1000).toFixed(0)}k`;
return value.toFixed(0);
if (value <= 1) return value.toFixed(2);
if (value >= 10000) return `${(value / 1000).toFixed(1)}k`;
return value.toFixed(1);
}
const handleYAxis = ({ dataSource, needUnit, curveCenter, showGridLine }) => {
// 一种指标一个y轴
......@@ -790,6 +790,7 @@ const handleGrid = (dataSource, needUnit, leftNum, rightNum, chartType) => {
top: _base + _topForUnit,
// left: leftNum === 1 ? 10 : leftNum * AXIS_WIDTH,
left: 10,
right:10,
// right: rightNum === 0 ? 20 : rightNum * AXIS_WIDTH,
bottom: 60,
containLabel: true,
......
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