You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/02/05 01:42:19 UTC

[GitHub] [echarts] akeagle commented on issue #14208: echarts5.0.1 和vue2.6 版本在使用新特性动态:动态柱状图,label会始终是0

akeagle commented on issue #14208:
URL: https://github.com/apache/echarts/issues/14208#issuecomment-773722382


   `<template>
     <div id="id" style="width: 100%; height: 500px"></div>
   </template>
   
   <script>
     import * as echarts from 'echarts';
     export default {
       name: 'test',
       mounted() {
         const res = [
           { name: '土采置存她', num: 79 },
           { name: '位件内月前', num: 827 },
           { name: '得三率别重', num: 99 },
           { name: '样名广斯', num: 356 },
           { name: '前象确', num: 359 },
         ];
         this.options = {
           xAxis: {
             type: 'value',
           },
           yAxis: {
             type: 'category',
             max: 3,
             animationDuration: 300,
             animationDurationUpdate: 300,
             inverse: true,
             data: res.map(i => {
               return i.name;
             }),
           },
           series: [
             {
               name: 'xxxxx',
               type: 'bar',
               realtimeSort: true,
               label: {
                 show: true,
                 position: 'right',
                 valueAnimation: true,
               },
               showBackground: true,
               data: res.map(i => {
                 return i.num;
               }),
             },
           ],
           animationDuration: 3000,
           animationDurationUpdate: 3000,
         };
         this.initChart();
       },
       methods: {
         initChart() {
           this.$nextTick(e => {
             this.chart = echarts.init(document.getElementById('id'));
             this.chart.setOption(this.options);
           });
         },
       },
     };
   </script>
   `


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org