feat:饼图样式调整

This commit is contained in:
zhangyu
2021-02-08 14:19:01 +08:00
parent 492796c62a
commit 1f10ebe724
3 changed files with 18 additions and 13 deletions

View File

@@ -836,14 +836,16 @@
if(chartInfo.type ==='pie'){ if(chartInfo.type ==='pie'){
pieSeries={ pieSeries={
type: 'pie', type: 'pie',
radius: ['20%', '100%'], radius: '100%',
center: ['50%', '50%'], center: ['50%', '50%'],
top:"20%", top:"20%",
bottom:"20%", bottom:"20%",
roseType: 'radius', // roseType: 'radius',
minAngle:10, minAngle:10,
itemStyle: { itemStyle: {
borderRadius: 5 borderRadius: 5,
borderColor: '#fff',
borderWidth: 1
}, },
label: { label: {
show: false show: false

View File

@@ -597,13 +597,13 @@ export default {
formatterFunc:function(params, ticket, callback){ formatterFunc:function(params, ticket, callback){
return ` return `
<div> <div>
<div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 12px;"> <div style="white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis; min-width: 150px; max-width: 600px; line-height: 18px; font-size: 14px;">
<div style="max-width: 500px;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;">${this.legend[params.dataIndex].alias}</div> <div style="max-width: 500px;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;margin-bottom: 5px">${this.legend[params.dataIndex].alias}</div>
<div style="display:flex;justify-content: space-between;"> <div style="font-size:12px;display:flex;justify-content: space-between;">
<div>value</div> <div>value</div>
<div>${params.value}</div> <div>${params.value}</div>
</div> </div>
<div style="display:flex;justify-content: space-between;"> <div style="font-size:12px;display:flex;justify-content: space-between;">
<div>percent</div> <div>percent</div>
<div>${params.percent}%</div> <div>${params.percent}%</div>
</div> </div>

View File

@@ -729,8 +729,9 @@
if(i===0){ if(i===0){
let value=item.data[0]; let value=item.data[0];
let t_date = new Date(value); let t_date = new Date(value);
str += bus.timeFormate(t_date) str +=`<div style="margin-bottom: 5px">`;
str +=`<br/>`; str += bus.timeFormate(t_date);
str +=`</div>`;
} }
let val =item.data[1]?parseFloat(Number(item.data[1]).toFixed(2)):''; let val =item.data[1]?parseFloat(Number(item.data[1]).toFixed(2)):'';
if(val===0){ if(val===0){
@@ -965,8 +966,9 @@
if(i===0){ if(i===0){
let value=item.data[0]; let value=item.data[0];
let t_date = new Date(value); let t_date = new Date(value);
str += bus.timeFormate(t_date) str +=`<div style="margin-bottom: 5px">`;
str +=`<br/>`; str += bus.timeFormate(t_date);
str +=`</div>`;
} }
let val = parseFloat(Number(item.data[1]).toFixed(2)); let val = parseFloat(Number(item.data[1]).toFixed(2));
if(val===0){ if(val===0){
@@ -1132,8 +1134,9 @@
if(i===0){ if(i===0){
let value=item.data[0]; let value=item.data[0];
let t_date = new Date(value); let t_date = new Date(value);
str += bus.timeFormate(t_date) str +=`<div style="margin-bottom: 5px">`;
str +=`<br/>`; str += bus.timeFormate(t_date);
str +=`</div>`;
} }
let val = parseFloat(Number(item.data[1]).toFixed(2)); let val = parseFloat(Number(item.data[1]).toFixed(2));
if(val===0){ if(val===0){