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 2020/01/20 09:04:20 UTC

[GitHub] [incubator-echarts] KLordy commented on issue #12093: 官网例子绘图显示报错

KLordy commented on issue #12093: 官网例子绘图显示报错
URL: https://github.com/apache/incubator-echarts/issues/12093#issuecomment-576175532
 
 
   > 您好,`echarts.min.js` 文件里面不可能有 `<!DOCTYPE html>`,有点不太清楚你是怎么用的。
   你好~ 我是直接下载的https://github.com/apache/incubator-echarts/tree/4.6.0/dist 里的`echarts.min.js`直接存储到对应项目路径,然后引用的html如下:
   ```
   <!DOCTYPE html>
   <html lang="en">
   <head>
       <meta charset="UTF-8" />
       <title>Title</title>
       <script src="js/echarts.min.js"></script>
   </head>
   <body>
   <div id="main" style="width: 600px;height:400px;"></div>
   <script type="text/javascript">
       // 基于准备好的dom,初始化echarts实例  -- MARK 这一行初始化echarts报错了!!
       var myChart = echarts.init(document.getElementById('main'));
   
       // 指定图表的配置项和数据
       var option = {
           title: {
               text: 'ECharts 入门示例'
           },
           tooltip: {},
           legend: {
               data:['销量']
           },
           xAxis: {
               data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
           },
           yAxis: {},
           series: [{
               name: '销量',
               type: 'bar',
               data: [5, 20, 36, 10, 10, 20]
           }]
       };
   
       // 使用刚指定的配置项和数据显示图表。
       myChart.setOption(option);
   </script>
   <p>测试mark</p>
   </body>
   </html>
   ```
   请问是我下载的文件不对么?

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


With regards,
Apache Git Services

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