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/05/18 03:34:44 UTC

[GitHub] [incubator-echarts] greedy747 commented on issue #8151: dataset 可以为每个数据指定样式

greedy747 commented on issue #8151:
URL: https://github.com/apache/incubator-echarts/issues/8151#issuecomment-629927226


   > 我还有一个想法,如果想数据和样式分离的话,可不可以在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这个强大的功能,也就没必要着急升级了。
   
   series里的itemStyle,label如果支持array,是不是可以解决问题?


----------------------------------------------------------------
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



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