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 02:17:10 UTC

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

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


   动态柱状图主要是针对数据更新时的动画,可能在初始化的时候也应用会有问题。我们在下个版本修复一下,先可以这样调整一下:
   
   ```js
   const res = [
       { name: '土采置存她', num: 0 },
       { name: '位件内月前', num: 0 },
       { name: '得三率别重', num: 0 },
       { name: '样名广斯', num: 0 },
       { name: '前象确', num: 0 },
   ];
   
   option = {
       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;
           }),
         },
       ],
       animationEasingUpdate: 'linear',
       animationDuration: 0,
       animationDurationUpdate: 3000,
   };
   
   setTimeout(function () {
      myChart.setOption({
           series: [{
               data: [79, 827, 99, 356, 359]
           }] 
      });
   });
   ```


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