|
@@ -1665,3 +1665,92 @@ export const quantitativeAnalysisProblems = (name = [], namexAxis = '', nameyAxi
|
|
|
|
|
|
return option;
|
|
|
};
|
|
|
+
|
|
|
+export const quantitativeAnalysisDashboard = (name = [], data = [], color = []) => {
|
|
|
+ const percent = data[0]; // 数值
|
|
|
+ let option = {
|
|
|
+ // backgroundColor: 'rgba(8, 17, 67, 0.9)',
|
|
|
+ title: {
|
|
|
+ text: name,
|
|
|
+ left: 'center',
|
|
|
+ top: '30%',
|
|
|
+ textStyle: {
|
|
|
+ color: 'rgba(245, 247, 247,0.6)',
|
|
|
+ fontSize: 16
|
|
|
+ },
|
|
|
+ subtext: `${percent} %`,
|
|
|
+ subtextStyle: {
|
|
|
+ color: 'rgba(245, 247, 247,1)',
|
|
|
+ fontSize: 16
|
|
|
+ }
|
|
|
+ },
|
|
|
+ polar: {
|
|
|
+ radius: ['75%', '100%'],
|
|
|
+ center: ['50%', '50%']
|
|
|
+ },
|
|
|
+ // 极坐标角度轴
|
|
|
+ angleAxis: {
|
|
|
+ min: 0,
|
|
|
+ max: 100,
|
|
|
+ // startAngle: 0,
|
|
|
+ // endAngle: -0,
|
|
|
+ clockwise: true,
|
|
|
+ show: false // 隐藏刻度线
|
|
|
+ },
|
|
|
+ // 极坐标径向轴
|
|
|
+ radiusAxis: {
|
|
|
+ type: 'category',
|
|
|
+ // 隐藏极坐标轴线
|
|
|
+ axisLine: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ axisTick: {
|
|
|
+ show: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: true,
|
|
|
+ formatter: (val) => {
|
|
|
+ return `${val.seriesName}: ${val.data}%`;
|
|
|
+ }
|
|
|
+ // backgroundColor: 'rgba(31, 196, 225, 0.2)',
|
|
|
+ // borderColor: 'rgba(31, 196, 225, 0.6)'
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ // 进度条
|
|
|
+ type: 'bar',
|
|
|
+ name: name,
|
|
|
+ coordinateSystem: 'polar',
|
|
|
+ // 设置柱子背景灰色,需开启showBackground才能显示backgroundStyle
|
|
|
+ showBackground: true,
|
|
|
+ backgroundStyle: {
|
|
|
+ // 外圈颜色
|
|
|
+ // color: 'rgba(14, 61, 128,0.3)',
|
|
|
+ },
|
|
|
+ // 两端设置圆角
|
|
|
+ roundCap: true,
|
|
|
+ itemStyle: {
|
|
|
+ color: {
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ x1: 0,
|
|
|
+ y1: 1,
|
|
|
+ colorStops: [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: 'rgba(94, 237, 204,0.65)'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: 'rgba(36,195,241,0.8)'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data: [percent]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ return option;
|
|
|
+};
|