update
1.修改大屏问题
This commit is contained in:
@@ -93,7 +93,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
const myChart = ref();
|
||||
function getData() {
|
||||
twoLApi({
|
||||
sex: chooseType.value,
|
||||
@@ -110,23 +109,24 @@
|
||||
});
|
||||
}
|
||||
|
||||
function initChart(value) {
|
||||
myChart.value = echarts.init(newChart.value!);
|
||||
function initChart(value: any) {
|
||||
let myChart = echarts.init(newChart.value);
|
||||
const dx =
|
||||
value.map((item) => {
|
||||
value.map((item: any) => {
|
||||
return item.name;
|
||||
}) || [];
|
||||
const dy =
|
||||
value.map((item) => {
|
||||
value.map((item: any) => {
|
||||
return item.count;
|
||||
}) || [];
|
||||
|
||||
const max = value.sort((a, b) => b.count - a.count).length > 0 ? value.sort((a, b) => b.count - a.count)[0].count : [];
|
||||
const max: any =
|
||||
value.sort((a: any, b: any) => b.count - a.count).length > 0 ? value.sort((a: any, b: any) => b.count - a.count)[0].count : [];
|
||||
const m = max % 25 === 0 ? max : (parseInt(max / 25) + 1) * 25;
|
||||
let option = getClassCharts(dx, dy, m);
|
||||
myChart.value.setOption(option);
|
||||
myChart.setOption(option);
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.value.resize();
|
||||
myChart && myChart.resize();
|
||||
});
|
||||
}
|
||||
const emit = defineEmits(['handleView']);
|
||||
|
||||
Reference in New Issue
Block a user