apex图表使用饼图居中_echarts饼图标题居中以及调整主副标题的间距、字号
text:主標(biāo)題
subtext:副標(biāo)題
textStyle: {} //主標(biāo)題的屬性設(shè)置
subtextStyle: {} //副標(biāo)題的屬性
itemGap:主副標(biāo)題之間的間距
textAlign:整體(包括 text 和 subtext)的水平對(duì)齊
項(xiàng)目個(gè)數(shù)是后臺(tái)返回的,直接渲染
function initThisMonthProjectsParticipate() {
$.ajax({
url: urlpic + "currentMonthParticipateProject",
type: 'get',
data: {
deptId: '4676',
},
success: function (data) {
console.log(data.participateProjectTotal, 'data');
let total = data.participateProjectTotal;
let dataOption = data.eChartResponseModel;
let styleOption = {
title: {
show: true,
text: '本月參評(píng)項(xiàng)目',
subtext: total + '個(gè)',
itemGap: 8,
left: '48%',
top: '45%',
textStyle: {
color: '#B4E4FF',
fontSize: 8 * sceenRate,
},
subtextStyle: {
color: '#B4E4FF',
fontSize: 8 * sceenRate,
},
textAlign:'center'
},
tooltip: {
trigger: 'item',
formatter: '{a}
{b}: {c} (ozvdkddzhkzd%)'//a 系列名稱,b 數(shù)據(jù)項(xiàng)名稱,c 數(shù)值,d 百分比
},
series: [{
name: '本月參評(píng)項(xiàng)目',
type: 'pie',
label: {
show: true,
alignTo: 'labelLine',
position: 'outside',
formatter: '{c}個(gè){b}項(xiàng)目',
fontSize: 6 * sceenRate,
alignTo: 'edge'
},
}]
}
let id = 'participateChart'
let chart = initCharts(id, dataOption, styleOption)
chart.on('click', function () {
initSecondLevelPage()
})
},
})
}
與50位技術(shù)專家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的apex图表使用饼图居中_echarts饼图标题居中以及调整主副标题的间距、字号的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: android模糊检索_【android
- 下一篇: 华为畅享8的悬浮窗在哪里_5000mAh