空间管理柱状图
parent
f66ced6631
commit
7baf391790
|
@ -7,6 +7,7 @@ import cn.palmte.work.model.SysRole;
|
|||
import cn.palmte.work.model.SysRoleRepository;
|
||||
import cn.palmte.work.pojo.SpaceVO;
|
||||
import cn.palmte.work.utils.InterfaceUtil;
|
||||
import cn.palmte.work.utils.Utils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -151,6 +152,8 @@ public class SpaceService {
|
|||
private SpaceVO combineData(List<Record> pie, List<Record> bar) {
|
||||
Map<String, Record> map = pie.stream().collect(Collectors.toMap(record -> String.valueOf(record.getInt("certainty")), Function.identity()));
|
||||
|
||||
bar = bar.stream().peek(a -> a.set("average", Utils.format(a.getBigDecimal("average")))).collect(Collectors.toList());
|
||||
|
||||
SpaceVO spaceVO = new SpaceVO();
|
||||
spaceVO.setMap(map);
|
||||
spaceVO.setList(bar);
|
||||
|
|
|
@ -90,7 +90,10 @@
|
|||
text: '项目金额及平均毛利率情况'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow'
|
||||
}
|
||||
},
|
||||
color:[colors[0], colors[1]],
|
||||
xAxis: {
|
||||
|
@ -134,7 +137,7 @@
|
|||
}
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: '{value}'
|
||||
formatter: '{value}%'
|
||||
},
|
||||
minInterval: 1,
|
||||
max: function(value) {
|
||||
|
@ -146,12 +149,23 @@
|
|||
{
|
||||
type: 'bar',
|
||||
yAxisIndex: 0,
|
||||
data: []
|
||||
data: [],
|
||||
label: {
|
||||
show: true,
|
||||
position: 'inside',
|
||||
color: 'black'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
yAxisIndex: 1,
|
||||
data: []
|
||||
data: [],
|
||||
label: {
|
||||
show: true,
|
||||
position: 'inside',
|
||||
color: 'black',
|
||||
formatter: '{c}%'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue