no message
Former-commit-id: a93fca08c3279a8a135e52ddad8dd3d42626fb17 Former-commit-id: 265098e111bf7be16c22c23b8b22beff40df2726 Former-commit-id: aa78e1a82a4c3f45882e646defe3f59c29bb97d3
This commit is contained in:
@@ -16,13 +16,19 @@ export default {
|
||||
this.creatChart()
|
||||
// 本组件的特殊设置
|
||||
this.chart.source(this.data)
|
||||
this.chart.axis('x', {
|
||||
label: {
|
||||
offset: 12
|
||||
}
|
||||
this.chart.coord('polar')
|
||||
this.chart.legend({
|
||||
position: 'right',
|
||||
offsetY: 0,
|
||||
offsetX: -140
|
||||
})
|
||||
this.chart.coord().transpose()
|
||||
this.chart.interval().position('x*y')
|
||||
this.chart.axis(false)
|
||||
this.chart.interval().position('item*count')
|
||||
.color('item', this.G2.Global.colors_pie_16)
|
||||
.style({
|
||||
lineWidth: 1,
|
||||
stroke: '#fff'
|
||||
})
|
||||
// 渲染图表
|
||||
this.chart.render()
|
||||
},
|
||||
|
||||
14
src/mock/chart/G2NightingaleRose.js
Normal file
14
src/mock/chart/G2NightingaleRose.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Mock from 'mockjs'
|
||||
import * as fn from './_fn'
|
||||
|
||||
Mock.mock('/api/chart/G2NightingaleRose', 'post', ({body, type, url}) => {
|
||||
const _body = JSON.parse(body)
|
||||
switch (_body.type) {
|
||||
// 基础南丁格尔玫瑰图
|
||||
case 'base': {
|
||||
return fn.returnMaker(['中国', '日本', '美国', '法国', '英国'].map(e => ({item: e, count: 100 + fn.r()})))
|
||||
}
|
||||
default:
|
||||
return {}
|
||||
}
|
||||
})
|
||||
@@ -4,7 +4,7 @@ import * as fn from './_fn'
|
||||
Mock.mock('/api/chart/G2Pie', 'post', ({body, type, url}) => {
|
||||
const _body = JSON.parse(body)
|
||||
switch (_body.type) {
|
||||
// 基础折线图
|
||||
// 基础饼图
|
||||
case 'base': {
|
||||
return fn.returnMaker(['中国', '日本', '美国', '法国', '英国'].map(e => ({item: e, count: fn.r()})))
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import './G2Bar'
|
||||
import './G2Column'
|
||||
import './G2Line'
|
||||
import './G2NightingaleRose'
|
||||
import './G2Pie'
|
||||
|
||||
Reference in New Issue
Block a user