|
|
@@ -76,22 +76,22 @@ export default {
|
|
|
},
|
|
|
label: {
|
|
|
formatter: function (name) {
|
|
|
- const text = name.name + '(' + name.value + ')'
|
|
|
+ const text = name.name
|
|
|
let result = ''// 拼接加\n返回的类目项
|
|
|
const maxLength = 7// 每项显示文字个数
|
|
|
const valLength = text.length// X轴类目项的文字个数
|
|
|
const rowNumber = Math.ceil(valLength / maxLength) // 类目项需要换行的行数
|
|
|
if (rowNumber > 1) { // 如果文字大于3,
|
|
|
- for (var i = 0; i < rowNumber; i++) {
|
|
|
+ for (let i = 0; i < rowNumber; i++) {
|
|
|
let temp = ''// 每次截取的字符串
|
|
|
const start = i * maxLength// 开始截取的位置
|
|
|
const end = start + maxLength// 结束截取的位置
|
|
|
- temp = text.substring(start, end) + '\n'
|
|
|
+ temp = text.substring(start, end) + (i === rowNumber - 1 ? '' : '\n')
|
|
|
result += temp // 拼接生成最终的字符串
|
|
|
}
|
|
|
- return result
|
|
|
+ return result + '(' + name.value + ')'
|
|
|
} else {
|
|
|
- return text
|
|
|
+ return text + '(' + name.value + ')'
|
|
|
}
|
|
|
},
|
|
|
edgeDistance: '20%',
|
|
|
@@ -99,22 +99,22 @@ export default {
|
|
|
fontSize: '12px'
|
|
|
},
|
|
|
legend: {
|
|
|
- // show: this.info.hasOwnProperty('legend') ? this.info.legend : true,
|
|
|
- show: true,
|
|
|
+ show: this.info.hasOwnProperty('legend') ? this.info.legend : true,
|
|
|
+ // show: true,
|
|
|
// orient: 'vertical',
|
|
|
itemGap: 6,
|
|
|
z: 3,
|
|
|
- type: this.info.hasOwnProperty('legend') && this.info.legend === false ? 'scroll' : 'plain',
|
|
|
- orient: this.info.hasOwnProperty('legend') && this.info.legend === false ? 'vertical' : 'horizontal',
|
|
|
- left: this.info.hasOwnProperty('legend') && this.info.legend === false ? 'left' : 'center',
|
|
|
+ // type: this.info.hasOwnProperty('legend') && this.info.legend === false ? 'scroll' : 'plain',
|
|
|
+ // orient: this.info.hasOwnProperty('legend') && this.info.legend === false ? 'vertical' : 'horizontal',
|
|
|
+ // left: this.info.hasOwnProperty('legend') && this.info.legend === false ? 'left' : 'center',
|
|
|
textStyle: {
|
|
|
color: '#fff'
|
|
|
},
|
|
|
- pageIconColor: '#fff',
|
|
|
- pageIconInactiveColor: '#fff',
|
|
|
- pageTextStyle: {
|
|
|
- color: '#fff'
|
|
|
- },
|
|
|
+ // pageIconColor: '#fff',
|
|
|
+ // pageIconInactiveColor: '#fff',
|
|
|
+ // pageTextStyle: {
|
|
|
+ // color: '#fff'
|
|
|
+ // },
|
|
|
formatter: function (name) {
|
|
|
const text = name
|
|
|
let result = ''// 拼接加\n返回的类目项
|
|
|
@@ -139,7 +139,7 @@ export default {
|
|
|
{
|
|
|
type: 'pie',
|
|
|
radius: radius,
|
|
|
- center: this.info.hasOwnProperty('legend') && this.info.legend === false ? ['60%', '50%'] : ['50%', '50%'],
|
|
|
+ center: this.info.hasOwnProperty('legend') && this.info.legend === false ? ['50%', '40%'] : ['50%', '50%'],
|
|
|
data: this.info.data,
|
|
|
emphasis: {
|
|
|
itemStyle: {
|