上下行统计以及转换单位

This commit is contained in:
lai
2024-01-26 17:02:11 +08:00
parent 231d0381d1
commit 308a66b925
5 changed files with 108 additions and 79 deletions

View File

@@ -15,13 +15,8 @@ import { BarChart, PieChart } from 'echarts/charts';
import { CanvasRenderer } from 'echarts/renderers';
import { LabelLayout } from 'echarts/features';
import useI18n from '@/hooks/useI18n';
import {
GridComponentOption,
LegendComponentOption,
LineSeriesOption,
TooltipComponentOption,
} from 'echarts';
const { t, currentLocale } = useI18n();
const { t } = useI18n();
echarts.use([
GridComponent,
BarChart,
@@ -106,11 +101,11 @@ function initPicture() {
// item.name = t('views.index.' + item.name);
// });
for (let i = 0; i < realData.length; i++) {
realData[i].name= t('views.index.' + realData[i].name);
realData[i].name = t('views.index.' + realData[i].name);
realData[i].itemStyle = {
color: colorList[i]
};
}
color: colorList[i],
};
}
const optionData: any = {
tooltip: {
trigger: 'item',
@@ -132,30 +127,6 @@ function initPicture() {
center: ['40%', '48%'],
data: realData,
roseType: 'radius',
// label: {
// formatter: '{c|{c}}\n{b|{b}}',
// rich: {
// c: {
// color: 'rgb(241,246,104)',
// fontSize: 20,
// fontWeight: 'bold',
// lineHeight: 5,
// },
// b: {
// color: 'rgb(98,137,169)',
// fontSize: 15,
// height: 40,
// },
// },
// },
// labelLine: {
// lineStyle: {
// color: 'rgb(98,137,169)',
// },
// smooth: 0.2,
// length: 10,
// length2: 20,
// },
label: {
formatter: '{c|{c}}\n{b|{b}}',
distance: 80,
@@ -222,4 +193,3 @@ onMounted(() => {
height: 100%;
}
</style>

View File

@@ -102,7 +102,7 @@ function initPicture() {
});
var charts = {
unit: '(Kbps)',
unit: '(Mbps)',
names: [
t('views.dashboard.overview.UPFFlow.up'),
t('views.dashboard.overview.UPFFlow.down'),
@@ -152,7 +152,6 @@ function initPicture() {
symbolSize: 5,
formatter: '{b}',
data: charts.value[i],
yAxisIndex: i,
};
lineY.push(data);
}
@@ -213,6 +212,9 @@ function initPicture() {
{
name: charts.unit,
type: 'value',
// splitNumber: 4,
min:0,
max:300,
axisLabel: {
formatter: '{value}',
},
@@ -227,23 +229,7 @@ function initPicture() {
},
},
},
{
name: charts.unit,
type: 'value',
axisLabel: {
formatter: '{value}',
},
splitLine: {
lineStyle: {
color: 'rgb(23,255,243,0.3)',
},
},
axisLine: {
lineStyle: {
color: 'rgb(0,253,255,0.6)',
},
},
},
],
series: lineY,
};