10000 [Bug] 桑基图 seriesField 不生效 · Issue #2678 · VisActor/VChart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Bug] 桑基图 seriesField 不生效 #2678
Closed
@xiaoluoHe

Description

@xiaoluoHe

Version

1.11.0

Link to Minimal Reproduction

Steps to Reproduce

const spec = {
  type: 'sankey',
  data: [
    {
      values: [
        {
          nodes:[
                {
                    "key": "A",
                    type:'1',
                },
                {
                    "key": "B",
                    type:'1',

                },
                {
                    "key": "C",
                    type:'2'
                },
                {
                    "key": "D",
                    type:'2'
                },
                {
                    "key": "E",
                    type:'3'
                },
                {
                    "key": "F",
                    type:'3'
                },
                {
                    "key": "G",
                    type:'3'
                }
            ],
          links: [
                {
                    "from": "A",
                    "to": "D",
                    "key": "A",
                    "value": 400
                },
                {
                    "from": "B",
                    "to": "D",
                    "key": "B",
                    "value": 400
                },
                {
                    "from": "C",
                    "to": "D",
                    "key": "C",
                    "value": 500
                },
                {
                    "from": "D",
                    "to": "F",
                    "key": "D",
                    "value": 800
                },
                {
                    "from": "C",
                    "to": "E",
                    "key": "C",
                    "value": 100
                },
                {
                    "from": "E",
                    "to": "G",
                    "key": "E",
                    "value": 100
                },
                {
                    "from": "D",
                    "to": "G",
                    "key": "D",
                    "value": 500
                }
            ]
        }
      ]
    }
  ],
  categoryField: 'key',
  valueField: 'value',
  sourceField: 'from',
  targetField: 'to',
  seriesField:'type',

  nodeAlign: 'justify',
  nodeGap: 8,
  nodeWidth: 15,
  minNodeHeight: 4,
  nodeKey: datum => datum.key,
  iterations: 20,

  label: {
    visible: true,
    style: {
      fontSize: 10,
      fill: 'black'
    }
  },
};

const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();

// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;

Current Behavior

image

Expected Behavior

颜色按照 seriesField 分组着色

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0