> `dimensions` 里面的值其实是用户自定义的,虽然叫做 `'name'`、`'value'`,echarts 并不能识别其含义。在没有提供 
> `encode` 信息的情况下,echarts 只是做猜测,如果第一列看着像是 文本的话,就作为 `name`,如果看着像数值的话,就作为 
> `value`。这种猜测策略是以 “多数场景” 的习惯状态为依据的。
> 
> 如果猜测不准确,那么就应该手动指定 `encode`,如:
> 
> ```js
> option = {
>     legend: {},
>     tooltip: {},
>     dataset: {
>         dimension:['name','value'],
>         source: [
>             ['10', 52.2],
>             ['20', 43.3],
>             ['30', 83.1],
>             ['40', 86.4],
>             ['50', 72.4]
>         ]
>     },
>     series: [{
>         type: 'pie',
>         encode: {
>             itemName: 0,
>             value: 1
>         }
>     }]
> };
> ```

在这个例子中,如果把name改成如下内容,饼图和legend显示都会有问题
```
dataset: {
        dimension:['name','value'],
        source: [
            ['1.0', 52.2],
            ['2.0.0', 43.3],
            ['3.1', 83.1],
            ['4.0', 86.4],
            ['5.1.1', 72.4]
        ]
    },
```
![image](https://user-images.githubusercontent.com/15317435/45527832-300dd300-b810-11e8-9631-9243f12dd0b0.png)


[ Full content available at: 
https://github.com/apache/incubator-echarts/issues/9028 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to