silencesky001 opened a new issue #15508:
URL: https://github.com/apache/echarts/issues/15508
### Version
5.1.2
### Steps to reproduce
vue component like this:
<template>
<div :style="{height:height,width:width}" />
</template>
<script>
import * as echarts from 'echarts';
//require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '230px'
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
}
},
data () {
return {
chart: null,
realtimedata: [0.9, 0.33, 0.35, 0.2, 0.65],
}
},
watch: {
chartData: {
deep: true,
handler (val) {
this.setOptions(val)
}
}
},
mounted () {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy () {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart () {
this.chart = echarts.init(this.$el)
this.setOptions(this.chartData)
},
setOptions ({ } = {}) {
this.chart.setOption({
grid: {
x: 5,
y: 5,
x2: 40,
y2: 5,
containLabel: true
},
xAxis: {
max: 'dataMax',
},
yAxis: {
type: 'category',
data: ['1-1号', '1-2号', '2-3号', '2-1号', '3-1号'],
inverse: true,
animationDuration: 0,
// animationDurationUpdate: 300,
max: 4 // only the largest 3 bars will be displayed
},
series: [{
realtimeSort: true,
name: 'X',
type: 'bar',
data: this.realtimedata,
label: {
show: true,
position: 'right',
valueAnimation: true
}
}],
legend: {
show: false
},
animationDuration: 300,
animationDurationUpdate: 300,
animationEasing: 'linear',
animationEasingUpdate: 'linear'
})
}
}
}
</script>
### What is expected?
all label display the right number
### What is actually happening?
if the chart resized the label display right number,but if don't resize just
static disply the chart ,all label is 0.
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]