Sinosaurus opened a new issue #12826:
URL: https://github.com/apache/incubator-echarts/issues/12826


   ### Version
   4.8.0
   
   ### Reproduction link
   
[https://codepen.io/sinosaurus/pen/mdVROmx](https://codepen.io/sinosaurus/pen/mdVROmx)
   
   ### Steps to reproduce
   ```
   var option = {
         grid: {
           // left: 0,
           show: true
         },
       // TODO: 此处添加了xAxis
          xAxis: {
            show: true,
            offset: 0
          },
         axisLine: {
           show: true,
           lineStyle: {
             color: 'red',
             width: 4,
           }
         },
         tooltip: {
           formatter: '{a} <br/>{b} : {c}%'
         },
         toolbox: {
           feature: {
             restore: {},
             saveAsImage: {}
           }
         },
         series: [{
           name: '业务指标',
           type: 'gauge',
           detail: {
             formatter: '{value}%'
           },
           data: [{
             value: 50,
             name: '完成率'
           }]
         }]
       };
   ```
   
   ### What is expected?
   可以控制图表距离x轴的位置
   
   ### What is actually happening?
   > 报错信息
   ```
   cartesianAxisHelper.js:43 Uncaught TypeError: axis.getAxesOnZeroOf is not a 
function
       at layout$1 (cartesianAxisHelper.js:43)
       at ExtendedClass.render (CartesianAxisView.js:62)
       at echarts.js:1549
       at Array.forEach (<anonymous>)
       at each$1 (util.js:295)
       at renderComponents (echarts.js:1547)
       at render (echarts.js:1530)
       at ECharts.update (echarts.js:891)
       at ECharts.echartsProto.setOption (echarts.js:392)
       at index.html:63
   ```
   简单看了下源码,`getAxesOnZeroOf` 在 原型中 `null` 
并不是一个方法,或者说没有走到去挂载`getAxesOnZeroOf`那儿就报错了
   
   ---
   类似的问题,有好多,但是并没有有效解决我的需求。这应该是一个很容易复现的bug,在使用 `xAxis`时,并没有明确需要的参数,因而无法有效解决了
   
   <!-- This issue is generated by echarts-issue-helper. 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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to