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/08/26 03:22:30 UTC

[GitHub] [echarts] yrx0823 opened a new issue #15608: 升级5.1版本后 点击还原按钮图像消失

yrx0823 opened a new issue #15608:
URL: https://github.com/apache/echarts/issues/15608


   ### Version
   5.1.0
   
   ### Steps to reproduce
   ```
   <script>
   import macarons from '@json/macarons.json'
   import echarts from 'echarts'
   export default {
     props: ['line_data'],
     data() {
       return {
         chart: null,
         options: {
           color: ['#13d6b2'],
           legend: {
             show: true,
           },
           toolbox: {
             show: true,
             orient: 'vertical',
             right: 5,
             feature: {
               dataZoom: {
                 show: true,
                 yAxisIndex: 'none',
               },
               restore: {},
             },
           },
           tooltip: {
             trigger: 'axis',
           },
           xAxis: {
             type: 'category',
             axisLabel: {
               formatter: function (value, index) {
                 const arr = value.split(' ')
                 const arr1 = arr[0].split('-')
                 if (index === 0) {
                   return value
                 } else {
                   return arr1[1]   '-'   arr1[2]   ' '   arr[1]
                 }
               },
             },
             boundaryGap: false,
             data: [],
           },
           yAxis: {
             type: 'value',
             axisLabel: {
               formatter: (val) => {
                 return val   this.line_data.unit
               },
             },
           },
           series: [
             {
               name: '',
               type: 'line',
               data: [],
               symbol: 'diamond',
               symbolSize: '4',
               smooth: false,
               lineStyle: {
                 width: 1.5,
               },
               itemStyle: {
                 color: '',
               },
             },
           ],
         },
       }
     },
     methods: {
       init_chart() {
         if (!this.chart) {
           echarts.registerTheme('macarons', macarons)
           this.chart = echarts.init(this.$refs.chart, 'macarons')
           this.chart_click()
         }
   
         this.chart.resize()
         this.chart.setOption(this.options)
       },
       chart_click() {
         this.chart.on('click', (params) => {
           this.$emit('view_client', params.name)
         })
       },
       listen_resize() {
         if (this.chart) {
           this.chart.resize()
         }
       },
     },
     watch: {
       line_data: {
         handler(newValue) {
           this.options.xAxis.data = newValue.time
           this.options.series[0].data = newValue.value
           this.options.series[0].name = newValue.series_name
           this.options.series[0].itemStyle.color = newValue.line_color
           this.$nextTick(() => {
             this.init_chart()
           })
         },
         deep: true,
         immediate: false,
       },
     },
     created() {
       window.addEventListener('resize', this.listen_resize)
       this.$once('hook:beforeDestroy', () => {
         window.removeEventListener('resize', this.listen_resize)
       })
     },
   }
   </script>
   ```
   
   ### What is expected?
   None
   
   ### What is actually happening?
   
   <!-- 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: commits-unsubscribe@echarts.apache.org

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


[GitHub] [echarts] flyfreereally commented on issue #15608: 升级5.1版本后 点击还原按钮图像消失

Posted by GitBox <gi...@apache.org>.
flyfreereally commented on issue #15608:
URL: https://github.com/apache/echarts/issues/15608#issuecomment-920597385


   请问这个问题解决了吗?我也遇到这个问题了。


-- 
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: commits-unsubscribe@echarts.apache.org

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


[GitHub] [echarts] coderkeke commented on issue #15608: 升级5.1版本后 点击还原按钮图像消失

Posted by GitBox <gi...@apache.org>.
coderkeke commented on issue #15608:
URL: https://github.com/apache/echarts/issues/15608#issuecomment-1008508014


   还原为什么还原到初始化未赋值的状态,以前都是还原到最后赋值的状态的呀


-- 
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: commits-unsubscribe@echarts.apache.org

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


[GitHub] [echarts] echarts-bot[bot] commented on issue #15608: 升级5.1版本后 点击还原按钮图像消失

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15608:
URL: https://github.com/apache/echarts/issues/15608#issuecomment-907971756


   @yrx0823 Please provide a minimum reproducible demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , https://www.makeapie.com/editor.html or https://codesandbox.io/s/mystifying-bash-2uthz.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.


-- 
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: commits-unsubscribe@echarts.apache.org

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


[GitHub] [echarts] echarts-bot[bot] commented on issue #15608: 升级5.1版本后 点击还原按钮图像消失

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15608:
URL: https://github.com/apache/echarts/issues/15608#issuecomment-906062250






-- 
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: commits-unsubscribe@echarts.apache.org

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