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:11:12 UTC

[GitHub] [echarts] yrx0823 opened a new issue #15607: 升级5.1版本后,点击还原按钮图消失了 (toolbox:feature:restore)

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


   
   `<script>
   import macarons from '@json/macarons.json'
   import echarts from 'echarts'
   export default {
     props: ['line_data', 'is_open'],
     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,
       },
       is_open(newValue) {
         setTimeout(() => {
           this.listen_resize()
         }, 400)
       },
     },
     created() {
       window.addEventListener('resize', this.listen_resize)
       this.$once('hook:beforeDestroy', () => {
         window.removeEventListener('resize', this.listen_resize)
       })
     },
   }
   </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.

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 #15607: 升级5.1版本后,点击还原按钮图消失了 (toolbox:feature:restore)

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


   This issue is not created using [issue template](https://ecomfe.github.io/echarts-issue-helper/) so I'm going to close it. 🙊
   Sorry for this, but it helps save our maintainers' time so that more developers get helped.
   Feel free to create another issue using the issue template.
   
   If you think you have already made your point clear without the template, or your problem cannot be covered by it, you may re-open this issue again.
   
   这个 issue 未使用 [issue 模板](https://ecomfe.github.io/echarts-issue-helper/?lang=zh-cn) 创建,所以我将关闭此 issue。
   为此带来的麻烦我深表歉意,但是请理解这是为了节约社区维护者的时间,以更高效地服务社区的开发者群体。
   如果您愿意,请使用 issue 模板重新创建 issue。
   
   如果您认为虽然没有使用模板,但您已经提供了复现问题的充分描述,或者您的问题无法使用模板表达,也可以重新 open 这个 issue。


-- 
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] closed issue #15607: 升级5.1版本后,点击还原按钮图消失了 (toolbox:feature:restore)

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] closed issue #15607:
URL: https://github.com/apache/echarts/issues/15607


   


-- 
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] Lee324 commented on issue #15607: 升级5.1版本后,点击还原按钮图消失了 (toolbox:feature:restore)

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


   同问,我也遇到了,怀疑toolbox还原机制有修改,旧版本没问题


-- 
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] Lee324 commented on issue #15607: 升级5.1版本后,点击还原按钮图消失了 (toolbox:feature:restore)

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


   echarts官网给了一个还原的重置事件--events. restore,我通过重置这个事件,成功避开了这个图形消失的问题。还考虑过通过自定义按钮实现的方法


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