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

桑基图设置layoutIterations: 0,排序仍然有问题 #20079

Open liwenming0808 opened 4 months ago

liwenming0808 commented 4 months ago

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=sankey-itemstyle&version=5.5.0

Steps to Reproduce

option = { tooltip: { trigger: 'item', triggerOn: 'mousemove' }, animation: false, series: [ { type: 'sankey', bottom: '10%', emphasis: { focus: 'adjacency' }, data: [

          {

                "name": "步骤一",

                "value": 1085,

                "id": "1",

                "mergeIdList": null,
                x: 10,
                y: 10

            },

            {

                "name": "步骤五",

                "value": 192,

                "id": "2",

                "mergeIdList": null,

            },

            {

                "name": "步骤四",

                "value": 184,

                "id": "11",

                "mergeIdList": null,

            },

            {

                "name": "步骤三",

                "value": 176,

                "id": "23",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 170,

                "id": "5",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 109,

                "id": "6",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 101,

                "id": "3",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 87,

                "id": "12",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 84,

                "id": "16",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 67,

                "id": "7",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 41,

                "id": "27",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 40,

                "id": "4",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 38,

                "id": "8",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 25,

                "id": "13",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 25,

                "id": "17",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 16,

                "id": "18",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 15,

                "id": "9",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 10,

                "id": "14",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 9,

                "id": "10",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 9,

                "id": "24",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 6,

                "id": "29",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 9,

                "id": "28",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 6,

                "id": "15",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 4,

                "id": "25",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 1,

                "id": "19",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 2,

                "id": "20",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 2,

                "id": "30",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 1,

                "id": "26",

                "mergeIdList": null

            },

            {

                "name": "步骤二",

                "value": 1,

                "id": "31",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 2,

                "id": "32",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 1,

                "id": "21",

                "mergeIdList": null

            },

            {

                "name": "步骤四",

                "value": 1,

                "id": "22",

                "mergeIdList": null

            },

            {

                "name": "步骤五",

                "value": 1,

                "id": "33",

                "mergeIdList": null

            },

            {

                "name": "步骤三",

                "value": 1,

                "id": "34",

                "mergeIdList": null

            }

  ],
  links: [

      {

                "source": "17",

                "target": "10",

                "value": 9

            },

            {

                "source": "7",

                "target": "17",

                "value": 25

            },

            {

                "source": "16",

                "target": "7",

                "value": 67

            },

            {

                "source": "7",

                "target": "13",

                "value": 25

            },

            {

                "source": "14",

                "target": "15",

                "value": 6

            },

            {

                "source": "9",

                "target": "24",

                "value": 9

            },

            {

                "source": "10",

                "target": "25",

                "value": 4

            },

            {

                "source": "1",

                "target": "2",

                "value": 192

            },

            {

                "source": "23",

                "target": "6",

                "value": 109

            },

            {

                "source": "25",

                "target": "26",

                "value": 1

            },

            {

                "source": "16",

                "target": "27",

                "value": 41

            },

            {

                "source": "18",

                "target": "29",

                "value": 6

            },

            {

                "source": "20",

                "target": "32",

                "value": 2

            },

            {

                "source": "5",

                "target": "12",

                "value": 87

            },

            {

                "source": "23",

                "target": "16",

                "value": 84

            },

            {

                "source": "12",

                "target": "27",

                "value": 41

            },

            {

                "source": "7",

                "target": "9",

                "value": 15

            },

            {

                "source": "24",

                "target": "25",

                "value": 4

            },

            {

                "source": "3",

                "target": "4",

                "value": 40

            },

            {

                "source": "21",

                "target": "22",

                "value": 1

            },

            {

                "source": "24",

                "target": "28",

                "value": 9

            },

            {

                "source": "32",

                "target": "33",

                "value": 1

            },

            {

                "source": "6",

                "target": "8",

                "value": 38

            },

            {

                "source": "10",

                "target": "15",

                "value": 6

            },

            {

                "source": "17",

                "target": "14",

                "value": 10

            },

            {

                "source": "12",

                "target": "7",

                "value": 67

            },

            {

                "source": "1",

                "target": "11",

                "value": 184

            },

            {

                "source": "2",

                "target": "6",

                "value": 109

            },

            {

                "source": "10",

                "target": "19",

                "value": 1

            },

            {

                "source": "17",

                "target": "24",

                "value": 9

            },

            {

                "source": "13",

                "target": "14",

                "value": 10

            },

            {

                "source": "27",

                "target": "13",

                "value": 25

            },

            {

                "source": "13",

                "target": "24",

                "value": 9

            },

            {

                "source": "8",

                "target": "13",

                "value": 25

            },

            {

                "source": "11",

                "target": "3",

                "value": 101

            },

            {

                "source": "9",

                "target": "29",

                "value": 6

            },

            {

                "source": "29",

                "target": "28",

                "value": 9

            },

            {

                "source": "27",

                "target": "17",

                "value": 25

            },

            {

                "source": "18",

                "target": "10",

                "value": 9

            },

            {

                "source": "23",

                "target": "3",

                "value": 101

            },

            {

                "source": "11",

                "target": "12",

                "value": 87

            },

            {

                "source": "12",

                "target": "8",

                "value": 38

            },

            {

                "source": "3",

                "target": "27",

                "value": 41

            },

            {

                "source": "2",

                "target": "3",

                "value": 101

            },

            {

                "source": "1",

                "target": "5",

                "value": 170

            },

            {

                "source": "4",

                "target": "17",

                "value": 25

            },

            {

                "source": "6",

                "target": "4",

                "value": 40

            },

            {

                "source": "5",

                "target": "16",

                "value": 84

            },

            {

                "source": "18",

                "target": "14",

                "value": 10

            },

            {

                "source": "8",

                "target": "9",

                "value": 15

            },

            {

                "source": "28",

                "target": "31",

                "value": 1

            },

            {

                "source": "33",

                "target": "34",

                "value": 1

            },

            {

                "source": "5",

                "target": "6",

                "value": 109

            },

            {

                "source": "29",

                "target": "15",

                "value": 6

            },

            {

                "source": "16",

                "target": "4",

                "value": 40

            },

            {

                "source": "20",

                "target": "21",

                "value": 1

            },

            {

                "source": "27",

                "target": "18",

                "value": 16

            },

            {

                "source": "9",

                "target": "10",

                "value": 9

            },

            {

                "source": "8",

                "target": "18",

                "value": 16

            },

            {

                "source": "4",

                "target": "9",

                "value": 15

            },

            {

                "source": "2",

                "target": "12",

                "value": 87

            },

            {

                "source": "19",

                "target": "20",

                "value": 2

            },

            {

                "source": "28",

                "target": "30",

                "value": 2

            },

            {

                "source": "6",

                "target": "7",

                "value": 67

            },

            {

                "source": "4",

                "target": "18",

                "value": 16

            },

            {

                "source": "13",

                "target": "29",

                "value": 6

            },

            {

                "source": "1",

                "target": "23",

                "value": 176

            },

            {

                "source": "11",

                "target": "16",

                "value": 84

            },

            {

                "source": "3",

                "target": "8",

                "value": 38

            },

            {

                "source": "31",

                "target": "32",

                "value": 2

            },

            {

                "source": "15",

                "target": "20",

                "value": 2

            },

            {

                "source": "14",

                "target": "28",

                "value": 9

            }

    ],
  label: {

        normal: {

            show: true, // 显示标签

             position: '', // 标签位置

            formatter: function(node) {

                // 自定义标签内容

                return node.data.name +'\n' + node.data.value;

            }

        }

  },
  layoutIterations: 0,
  nodeGap: 42,
  lineStyle: {
    color: 'source',
    curveness: 0.5
  }
}

] };

Current Behavior

Snipaste_2024-06-26_18-55-03

Expected Behavior

Snipaste_2024-06-26_18-56-14

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

echarts-bot[bot] commented 4 months ago

@liwenming0808 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED
**TITLE** Sankey charts set layoutIterations: 0 and there is still a problem with sorting
Ovilia commented 4 months ago

Please make the demo data minimal.

fandi-1205 commented 3 months ago

Maybe this is the result you want. Looking at the official documentation, we can know that there are node-related configurations in the Sankey diagram. image Therefore, you may need to set the depth of the node.The result is shown in the figure image