|
@@ -111,19 +111,20 @@ function barOption(data, barConfig) {
|
|
|
|
|
|
|
|
function pieOption(data, pieConfig) {
|
|
function pieOption(data, pieConfig) {
|
|
|
let columnName = pieConfig.xAxis.column.label + (pieConfig.xAxis.granularity.value ? '('+pieConfig.xAxis.granularity.label+')' : '');
|
|
let columnName = pieConfig.xAxis.column.label + (pieConfig.xAxis.granularity.value ? '('+pieConfig.xAxis.granularity.label+')' : '');
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ console.log(pieConfig);
|
|
|
let option = {
|
|
let option = {
|
|
|
tooltip : {
|
|
tooltip : {
|
|
|
trigger: 'item',
|
|
trigger: 'item',
|
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: data.xAxis
|
|
|
|
|
|
|
+ data: (data.xAxis || []).map(d => d || '空')
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
left: '10%',
|
|
left: '10%',
|
|
|
right: '10%',
|
|
right: '10%',
|
|
|
- top: 60,
|
|
|
|
|
|
|
+ top: 100,
|
|
|
bottom: 60,
|
|
bottom: 60,
|
|
|
containLabel: true
|
|
containLabel: true
|
|
|
},
|
|
},
|
|
@@ -133,7 +134,7 @@ function pieOption(data, pieConfig) {
|
|
|
type: 'pie',
|
|
type: 'pie',
|
|
|
// radius : '55%',
|
|
// radius : '55%',
|
|
|
// center: ['50%', '60%'],
|
|
// center: ['50%', '60%'],
|
|
|
- data: (data.serieses || [])[0].value,
|
|
|
|
|
|
|
+ data: (data.serieses || [{ value: [] }])[0].value.map(v => ({ ...v, name: v.name || '空' })),
|
|
|
itemStyle: {
|
|
itemStyle: {
|
|
|
emphasis: {
|
|
emphasis: {
|
|
|
shadowBlur: 10,
|
|
shadowBlur: 10,
|
|
@@ -145,6 +146,7 @@ function pieOption(data, pieConfig) {
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ console.log(option);
|
|
|
return option;
|
|
return option;
|
|
|
}
|
|
}
|
|
|
|
|
|