Using Echarts3.0 in Vuejs2.0 component, I am trying to assign percent on y-axis in a stacked bar chart. I tried boundaryGap, splitnumber, etc, but none of them worked. But i cannot achieve it, Anyone has idea how can i get % on y-axis?
export default {
data: () => ({
loading: true,
bar: {
xAxis: {
type: 'category',
data: ['Location1','Location2']
},
yAxis: {
type: 'value',
splitNumber: 10,
boundaryGap: ['0', '100%'],
min:0,
max:100,
scale:true,
splitArea : {show : true},
label: {
formatter: function(){
return 100 * value /$(this.axis.tickPositions).last()[0]
+ '%';
}
}
},
series: [
{
name: 'Location1',
type: 'bar',
stack: 'one',
label: {
normal: {
show: true,
position: 'insideRight'
}
},
data: [1100, 2050]
},
{
name: 'Location2',
type: 'bar',
stack: 'one',
label: {
normal: {
show: true,
position: 'insideRight'
}
},
data: [291064, 34789]
}
]
}
})