vue-charts-jf
v1.0.9
Published
A Vue.js project
Downloads
20
Readme
vue-charts
A Vue.js project
github地址:https://github.com/jianfeng418/vue-charts
Usage NPM
npm install vue-charts-jf --save
import vueChart from 'vue-charts-jf'
Vue.use(vueChart);
vue-bar柱状图
使用示例:
<button @click='updateBar' style='float:left'>update</button>
<vue-bar ref='vuebar' :barData='barData' :barWid='50' class='barDiv' style='clear:both'></vue-bar>
<vue-bar ref='perbar' :barData='percentData' :maxValue='1' dataType='percent' :tickValue='0.2' :precision='2' class='barDiv' ></vue-bar>
...
data () {
return {
msg: 'Welcome to Your vue-charts',
barData:{
title:'业绩(单位w)',
list:[
{color:'#53b85e',title:'一季度',num:5},
{color:'#53805e',title:'二季度',num:14},
{color:'#4efff0',title:'三季度',num:6},
{color:'#8a94ee',title:'四季度',num:16},
]
},
percentData:{
title:'业绩达成率',
list:[
{color:'#53b85e',title:'一季度',num:0.15},
{color:'#53805e',title:'二季度',num:0.84},
{color:'#4efff0',title:'三季度',num:0.6},
{color:'#8a94ee',title:'四季度',num:0.76},
]
}
}
}
...
methods:{
updateBar(){
this.barData.list = [
{color:'#53b85e',title:'一季度',num:8},
{color:'#53805e',title:'二季度',num:12},
{color:'#4efff0',title:'三季度',num:9},
{color:'#8a94ee',title:'四季度',num:18}
]
this.percentData.list = [
{color:'#53b85e',title:'一季度',num:0.35},
{color:'#53805e',title:'二季度',num:0.74},
{color:'#4efff0',title:'三季度',num:0.56},
{color:'#8a94ee',title:'四季度',num:0.86},
]
this.$refs.vuebar.draw();
this.$refs.perbar.draw();
}
}
参数说明
barData数据格式:
barData.list数据格式:
方法说明:
vue-circle圆形进度图
使用示例:
<div class='circleDiv'>
<vue-circle :circleData='circleData' style='height:300px' centerText='22' :showTip='true' :showLegend='true' ></vue-circle>
</div>
<div class='circleDiv' >
<vue-circle :circleData='perCircleData' style='height:300px' centerText='22%' :showTip='true' :showLegend='true' :centerStyle='cenStyle'></vue-circle>
</div>
...
data () {
return {
msg: 'Welcome to Your vue-charts',
circleData:{
totle:23,
list:[
{num:8,title:'一季度',color:'#53b85e'},
{num:3,title:'二季度',color:'#53805e'},
{num:5,title:'三季度',color:'#4e1ff0'},
{num:7,title:'四季度',color:'#8a94ee'}
]
},
perCircleData:{
totle:23,
list:[
{num:8,title:'一季度',color:'#53b85e'},
]
},
cenStyle:{
fontSize:'24px',
fontFamily:'sans-serif',
fontColor:'#999'
}
}
}
参数说明
circleData数据格式:
circleData.list数据格式:
方法说明: