apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.49k stars 19.61k forks source link

[Feature] Sankey node colors correspond to node's value or not. #18346

Open Mingeax opened 1 year ago

Mingeax commented 1 year ago

What problem does this feature solve?

Now sankey chart's node colors is not in 'option.color' order but corresponding to node's value, by default. If I want to achieve that, must set 'series.node.itemStyle[i].color' one by one. It would be better if there is an option deciding whether the node colors are by 'option.color' or node's value. Or does any exsitng option have that function?

What does the proposed API look like?

serie: [{
  itemStyle: {
    colorInOrder: 'value' | 'sequence' 
  }
}]
helgasoft commented 1 year ago

Good point, means also current documentation is incomplete. sankey.data.itemStyle.color should be updated to say "Default color order is by node value". Demo Code