no message

Former-commit-id: 8a753edd42d69a67a150f6bc7a6f86758b3e5bd6
Former-commit-id: e0dfdff9c10fd4aefae8ecaf8a4f6a5dbc51ba00
Former-commit-id: 70688bf6cb4637de4c6dc82d40a4307924eba73a
This commit is contained in:
李杨
2018-02-18 22:28:29 +08:00
parent 1f0d5ce882
commit 61f3ab6a75

View File

@@ -26,16 +26,12 @@ export default {
}, },
// 初始化图表 // 初始化图表
init () { init () {
console.log('pie base')
// mixin 中提供 creatChart // mixin 中提供 creatChart
this.creatChart() this.creatChart()
// 本组件的特殊设置 // 本组件的特殊设置
this.chart.source(this.dvMaker(), { this.chart.source(this.dvMaker(), {
percent: { percent: {
formatter: val => { formatter: val => (val * 100).toFixed(2) + '%'
val = (val * 100).toFixed(2) + '%'
return val
}
} }
}) })
this.chart.coord('theta', { this.chart.coord('theta', {
@@ -49,17 +45,12 @@ export default {
.position('percent') .position('percent')
.color('item') .color('item')
.label('percent', { .label('percent', {
formatter: (val, item) => { formatter: (val, item) => item.point.item + ': ' + val
return item.point.item + ': ' + val
}
}) })
.tooltip('item*percent', (item, percent) => { .tooltip('item*percent', (item, percent) => ({
percent = (percent * 100).toFixed(2) + '%'
return {
name: item, name: item,
value: percent value: (percent * 100).toFixed(2) + '%'
} }))
})
.style({ .style({
lineWidth: 1, lineWidth: 1,
stroke: '#fff' stroke: '#fff'