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


   ### Version
   5.0.0
   
   ### Steps to reproduce
       import echarts from 'echarts/lib/echarts';
       import 'echarts/lib/chart/line';
   
       const chartNumberA = echarts.init(document.getElementById('xxx'));
   
       const option = {
         xAxis: {
           type: 'category',
           boundaryGap: false,
           data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
         },
         yAxis: {
           type: 'value'
         },
         series: [
           {
             data: [820, 932, 901, 934, 1290, 1330, 1320],
             type: 'line',
             areaStyle: {}
           }
         ]
       };
   
       chartNumberA.setOption(option);
   
   ### What is expected?
   希望按需引入能够正常工作。
   
   ### What is actually happening?
   报错:Cannot read property 'scale' of undefined
   
   定位:
   ```
       var xAxis = xAxisModel.axis;
       var yAxis = yAxisModel.axis;
       var xRawExtentInfo = xAxis.scale.rawExtentInfo;
       var yRawExtentInfo = yAxis.scale.rawExtentInfo;
   ```
   
   直接全局引入`var echarts = require('echarts');`则没有这个问题。
   
   <!-- 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.

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