Mignon-han commented on issue #8151: [enhancement]dataset 的每个数据可以支持指定样式
URL: 
https://github.com/apache/incubator-echarts/issues/8151#issuecomment-381038722
 
 
   我还有一个想法,如果想数据和样式分离的话,可不可以在dataset里面加一种新的 `dimension`类型, 
比如说名为`style`,可以用来把样式映射到series的每个数据中。
   ```
   option = {
     dataset: {
       dimensions: ['score', 'amount', 'product', {name: 'scoreStyle',type: 
'style'}],
       source: [
         [89.3, 58212, 'Matcha Latte', {color: 'red' }],
         [57.1, 78254, 'Milk Tea', {color: 'blue' }],
         [74.4, 41032, 'Cheese Cocoa', {color: 'green' }]
         ...
       ]
     },
     series: [{
       type: 'bar',
       encode: {
         x: 'product',
         y: 'score',
         style: 'scoreStyle'
       }
     }]
   }
   ```
   因为`series.data[i]` 是可以是对象,并且可以为每个`data[i]`指定样式。
   我们很想把产品的eCharts版本升级到4.x, 但是为每一个data[i] 
,指定样式的功能实现不了的话,就没办法使用dataset这个强大的功能,也就没必要着急升级了。

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@echarts.apache.org
For additional commands, e-mail: dev-h...@echarts.apache.org

Reply via email to