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:
us...@infra.apache.org



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

Reply via email to