This commit is contained in:
刘龙龙 2023-12-15 10:36:42 +08:00
parent 6afdbd4d85
commit d12dd164c5
4 changed files with 273 additions and 15002 deletions

View File

@ -14,7 +14,7 @@ const getPie3D = (
alpha, alpha,
pieHeight, pieHeight,
opacity = 1 opacity = 1
) => { ) => {
const series = []; const series = [];
let sumValue = 0; let sumValue = 0;
let startValue = 0; let startValue = 0;
@ -171,19 +171,19 @@ const getPie3D = (
series: series, series: series,
}; };
return option; return option;
}; };
/** /**
* 生成扇形的曲面参数方程用于 series-surface.parametricEquation * 生成扇形的曲面参数方程用于 series-surface.parametricEquation
*/ */
const getParametricEquation = ( const getParametricEquation = (
startRatio, startRatio,
endRatio, endRatio,
isSelected, isSelected,
isHovered, isHovered,
k, k,
h h
) => { ) => {
// 计算 // 计算
const midRatio = (startRatio + endRatio) / 2; const midRatio = (startRatio + endRatio) / 2;
const startRadian = startRatio * Math.PI * 2; const startRadian = startRatio * Math.PI * 2;
@ -248,22 +248,22 @@ const getPie3D = (
return Math.sin(v) > 0 ? 1 * h * 0.1 : -1; return Math.sin(v) > 0 ? 1 * h * 0.1 : -1;
}, },
}; };
}; };
/** /**
* 获取3d丙图的最高扇区的高度 * 获取3d丙图的最高扇区的高度
*/ */
const getHeight3D = (series, height) => { const getHeight3D = (series, height) => {
series.sort((a, b) => { series.sort((a, b) => {
return b.pieData.value - a.pieData.value; return b.pieData.value - a.pieData.value;
}); });
return (height * 25) / series[0].pieData.value; return (height * 25) / series[0].pieData.value;
}; };
/** /**
* 格式化浮点数 * 格式化浮点数
*/ */
const fomatFloat = (num, n) => { const fomatFloat = (num, n) => {
let f = parseFloat(num); let f = parseFloat(num);
if (isNaN(f)) { if (isNaN(f)) {
return false; return false;
@ -280,8 +280,6 @@ const getPie3D = (
s += "0"; s += "0";
} }
return s; return s;
}; };
export { getPie3D, getParametricEquation };
export { getPie3D, getParametricEquation };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -442,10 +442,7 @@ export default {
myChart.setOption(this.option1); myChart.setOption(this.option1);
}, },
}, },
mounted() { mounted() {},
this.dldy();
this.ssfh();
},
beforeDestroy() { beforeDestroy() {
this.falg = false; this.falg = false;
}, },