关系图circular只有两个节点时节点会重叠 #4084

Closed
lastmayday opened this Issue Sep 14, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@lastmayday

问题简述 (One-line summary)

关系图的 layout 设置为 circular, 如果 data 只有两个节点, 那么这两个节点会重叠

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):3.2.3
  • 浏览器类型和版本 (Browser version):Chrome 版本 52.0.2743.116 (64-bit)
  • 操作系统类型和版本 (OS Version):OS X El Captian 10..11.5

重现步骤 (Steps to reproduce)

  1. 关系图的 layout 设置为 circular
  2. data 只有两个数据

期望结果 (Expected behaviour)

两个节点分开显示

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

option = {
            title: {
                text: 'test',
                top: 'bottom',
                left: 'right'
            },
            legend: [{
                data: me.categories.map(function (a) {
                    return a.name;
                })
            }],
            animationDurationUpdate: 1500,
            animationEasingUpdate: 'quinticInOut',
            tooltip: {
                trigger: 'item',
                position: function (point) {
                    return [point[0], 0];
                }
            },
            series : [{
                type: 'graph',
                layout: 'circular',
                data: [{
                    id: 'aaa',
                    name: 'aaa',
                    value: 'aaa',
                    symbolSize: 10,
                    tooltip: {
                        formatter: function (params) {
                            return params.name + ' <br> ' + params.value;
                        }
                    },
                    category: 0
                }, {
                    id: 'bbb',
                    name: 'bbb',
                    value: 'bbb',
                    symbolSize: 10,
                    tooltip: {
                        formatter: function (params) {
                            return params.name + ' <br> ' + params.value;
                        }
                    },
                    category: 1
                }],
                links: [],
                label: {
                    normal: {
                        position: 'right',
                        show: true
                    }
                },
                roam: true,
                categories: me.categories,
                focusNodeAdjacency: true,
                lineStyle: {
                    normal: {
                        width: 1,
                        curveness: 0.3,
                        opacity: 0.7
                    }
                }
            }]
}

其他信息 (Other comments)

节点重叠

@pissang pissang added the enhancement label Sep 18, 2016

@la0wang

This comment has been minimized.

Show comment
Hide comment
@la0wang

la0wang Sep 30, 2016

只要是偶数,就会重叠,很纠结。。。

la0wang commented Sep 30, 2016

只要是偶数,就会重叠,很纠结。。。

@100pah 100pah closed this in f9707fd Oct 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment