You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/11/09 07:54:20 UTC

[GitHub] elephantme edited a comment on issue #9363: Dataset的dimensions存在'0',无法正常工作,图表报错

elephantme edited a comment on issue #9363: Dataset的dimensions存在'0',无法正常工作,图表报错
URL: https://github.com/apache/incubator-echarts/issues/9363#issuecomment-437278731
 
 
   > http://echarts.baidu.com/option.html#dataset.dimensions 参考 dimensions 文档里,可以设置字段类型,“0” 这样的可能会被自动识别成数字
   
   我换成这种写法可以了:
   
   ```javascript
   option = {
       legend: {},
       tooltip: {},
       dataset: {
           dimensions: ['product', {displayName: '0'}, '2', '3'],
           source: [
               ['Matcha Latte', 43.3, 85.8, 93.7],
               ['Milk Tea', 83.1, 73.4, 55.1],
               ['Cheese Cocoa', 86.4, 65.2, 82.5],
               ['Walnut Brownie', 72.4, 53.9, 39.1]
           ]
       },
       xAxis: {type: 'category'},
       yAxis: {},
       // Declare several bar series, each will be mapped
       // to a column of dataset.source by default.
       series: [
           {type: 'bar'},
           {type: 'bar'},
           {type: 'bar'}
       ]
   };
   ```
   
   你说的dimensions中的type我理解是指定dataset中data的数据类型的。目前这个问题是维度名称中出现'0',js就会报错,换成'1'都是可以正常展示的。
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org