|
@@ -180,6 +180,57 @@ export const preOption = (
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+export const preOptions = (
|
|
|
|
|
+ data,
|
|
|
|
|
+ radius = ['45%', '60%'],
|
|
|
|
|
+ labelLineShow = true,
|
|
|
|
|
+ labelPosition = 'outside'
|
|
|
|
|
+) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ color: ['#398f4e', '#458ef7', '#fdc537', '#fe6869', '#975fe6'],
|
|
|
|
|
+ tooltip: {
|
|
|
|
|
+ formatter: function (params) {
|
|
|
|
|
+ return `${params.name}<br/>数量: ${params.value}<br/>占比: ${params.percent}%`;
|
|
|
|
|
+ },
|
|
|
|
|
+ // formatter: '{d}%',
|
|
|
|
|
+ trigger: 'item'
|
|
|
|
|
+ },
|
|
|
|
|
+ legend: {
|
|
|
|
|
+ orient: 'vertical',
|
|
|
|
|
+ left: 'left',
|
|
|
|
|
+ left: '10%',
|
|
|
|
|
+ top: '25%',
|
|
|
|
|
+ itemGap: window.innerHeight * 0.018,
|
|
|
|
|
+ textStyle: {
|
|
|
|
|
+ fontSize: window.innerHeight * 0.014
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ series: [
|
|
|
|
|
+ {
|
|
|
|
|
+ center: ['60%', '50%'],
|
|
|
|
|
+ label: {
|
|
|
|
|
+ position: labelPosition,
|
|
|
|
|
+ show: true,
|
|
|
|
|
+ formatter: '{c}',
|
|
|
|
|
+ fontSize: window.innerHeight * 0.014
|
|
|
|
|
+ // color:"#fff"
|
|
|
|
|
+ },
|
|
|
|
|
+ labelLine: {
|
|
|
|
|
+ show: labelLineShow
|
|
|
|
|
+ },
|
|
|
|
|
+ type: 'pie',
|
|
|
|
|
+ radius,
|
|
|
|
|
+ itemStyle: {
|
|
|
|
|
+ borderWidth: 0,
|
|
|
|
|
+ shadowBlur: 10,
|
|
|
|
|
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
|
|
|
|
|
+ },
|
|
|
|
|
+ data
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ };
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
export const lineOption = (data, type) => {
|
|
export const lineOption = (data, type) => {
|
|
|
console.log(getDatesInMonth(), 'getDatesInMonth');
|
|
console.log(getDatesInMonth(), 'getDatesInMonth');
|
|
|
|
|
|