`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
}
}]
};
```
[ Full content available at:
https://github.com/apache/incubator-echarts/issues/9028 ]
This message was relayed via gitbox.apache.org for [email protected]