|
@@ -214,6 +214,83 @@ export const ringTypeEnlarge = (color = [], data = [], title = {}, legendFcuntio
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+export const ringTypeEnlarges = (color = [], data = [], title = {}, legendFcuntion = {}) => {
|
|
|
+ let legendFcuntionValue = (v) => {
|
|
|
+ let val = '';
|
|
|
+ data.map((item) => {
|
|
|
+ if (item.name == v) {
|
|
|
+ if (legendFcuntion.type == '%') {
|
|
|
+ val = `{a|${v}} · · · · · · {b|${parseInt((item.value / legendFcuntion.total).toFixed(2) * 100) || 0}%}`;
|
|
|
+ } else {
|
|
|
+ if (v.length > 5 || v.length == 5) {
|
|
|
+ let va = v.substr(0, 3) + '…';
|
|
|
+ val = `{a|${va}} · · · · {b|${item.value}}`;
|
|
|
+ } else if (item.value.length == 4 || item.value.length > 4) {
|
|
|
+ let itval = item.value.substr(0, 4) + '…';
|
|
|
+ val = `{a|${v}} · · · · {b|${itval}}`;
|
|
|
+ } else if ((v.length > 5 || v.length == 5) && (item.value.length == 4 || item.value.length > 4)) {
|
|
|
+ let va = v.substr(0, 3) + '…';
|
|
|
+ let itval = item.value.substr(0, 4) + '…';
|
|
|
+ val = `{a|${va}} · · · · {b|${itval}}`;
|
|
|
+ } else {
|
|
|
+ val = `{a|${v}} · · · · {b|${item.value}}`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return val;
|
|
|
+ };
|
|
|
+ return {
|
|
|
+ tooltip: {
|
|
|
+ trigger: 'item'
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ orient: 'vertical',
|
|
|
+ right: 0,
|
|
|
+ top: 100,
|
|
|
+ itemGap: 10,
|
|
|
+ itemWidth: 12, // 图例图形宽度
|
|
|
+ itemHeight: 8,
|
|
|
+ type: 'scroll',
|
|
|
+ formatter: (v) => {
|
|
|
+ return legendFcuntionValue(v);
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ rich: {
|
|
|
+ a: {
|
|
|
+ fontSize: 12,
|
|
|
+ color: '#858892',
|
|
|
+ padding: [0, 5, 0, 0]
|
|
|
+ },
|
|
|
+ b: {
|
|
|
+ fontSize: 14,
|
|
|
+ color: '#fff',
|
|
|
+ padding: [0, 0, 0, 5]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ title,
|
|
|
+ color: !!color.length ? color : defaultColor,
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ type: 'pie',
|
|
|
+ radius: ['55%', '70%'],
|
|
|
+ avoidLabelOverlap: false,
|
|
|
+ center: ['25%', '50%'],
|
|
|
+ label: {
|
|
|
+ show: false,
|
|
|
+ position: 'center'
|
|
|
+ },
|
|
|
+ labelLine: {
|
|
|
+ show: false
|
|
|
+ },
|
|
|
+ data: data
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+};
|
|
|
+
|
|
|
// 折现波浪
|
|
|
export const discountedWave = (name = '', xAxis = [], series = [], legendShow = false, color = []) => {
|
|
|
let option = {
|
|
@@ -1428,21 +1505,21 @@ export const quantitativeAnalysisDashboardEnlarge = (name = [], data = [], color
|
|
|
title: {
|
|
|
text: name,
|
|
|
left: '33%',
|
|
|
- top: '40%',
|
|
|
+ top: '35%',
|
|
|
textAlign: 'center',
|
|
|
textStyle: {
|
|
|
- color: 'rgba(245, 247, 247,0.6)',
|
|
|
+ color: '#858892',
|
|
|
fontSize: 14
|
|
|
},
|
|
|
subtext: `${percent} %`,
|
|
|
subtextStyle: {
|
|
|
- color: 'rgba(245, 247, 247,1)',
|
|
|
- fontSize: 26
|
|
|
+ color: '#fff',
|
|
|
+ fontSize: 20
|
|
|
}
|
|
|
},
|
|
|
polar: {
|
|
|
- radius: ['60%', '75%'],
|
|
|
- center: ['35%', '50%']
|
|
|
+ radius: ['55%', '75%'],
|
|
|
+ center: ['35%', '45%']
|
|
|
},
|
|
|
// 极坐标角度轴
|
|
|
angleAxis: {
|