Browse Source

交通流

develop
王兴琳 3 months ago
parent
commit
5f20aee1be
  1. 19
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/analysis/flow/index.vue

19
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/analysis/flow/index.vue

@ -62,7 +62,22 @@ export default {
direction: data.direction
}
}).then(resLastYear=>{
chartsStatistics.xAxis.data = res.data.map(x=>x.name);
// '-'
function splitNameByDash(name) {
const parts = name.split('-');
if (parts.length > 1) {
return `${parts[0]}\n${parts.slice(1).join('-')}`;
}
return name;
}
chartsStatistics.xAxis.data = res.data.map(x=>splitNameByDash(x.name));
chartsStatistics.xAxis.axisLabel = {
fontSize: 15, //
formatter: function (value) {
return value;
}
};
chartsStatistics.series[0].data = res.data.map(x=>x.totalPassengerFlow);
chartsStatistics.series[1].data = res.data.map(x=>x.typeTruckFlow);
chartsStatistics.series[2].data = res.data.map(x=>x.typeSpecialVehicleFlow);
@ -78,6 +93,8 @@ export default {
}
},
mounted() {
// '-'
// this.$nextTick(() => {
// var myChart = echarts.init(document.getElementById("anaFlow"));
// myChart.setOption(chartsStatistics);

Loading…
Cancel
Save