apache / echarts

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

笛卡尔坐标系上的 Graph 不支持 roam ? #7774

Closed maoyr closed 6 years ago

maoyr commented 6 years ago

One-line summary [问题简述]

在例子‘笛卡尔坐标系上的 Graph’ 中设置 roam: true,发现并不支持平移缩放。 设置了 dataZoom 控制缩放,平移暂未解决。

Version & Environment [版本及环境]

Expected behaviour [期望结果]

对控制平移是否有好的解决办法? 还是说需要自己写平移事件?

ECharts option [ECharts配置项]

var axisData = ['周一','周二','周三','很长很长的周四','周五','周六','周日'];
var data = axisData.map(function (item, i) {
    return Math.round(Math.random() * 1000 * (i + 1));
});
var links = data.map(function (item, i) {
    return {
        source: i,
        target: i + 1
    };
});
links.pop();
option = {
    title: {
        text: '笛卡尔坐标系上的 Graph'
    },
    tooltip: {},
    xAxis: {
        type : 'category',
        boundaryGap : false,
        data : axisData
    },
    yAxis: {
        type : 'value'
    },
    series: [
        {
            type: 'graph',
            layout: 'none',
            roam:true,
            coordinateSystem: 'cartesian2d',
            symbolSize: 40,
            label: {
                normal: {
                    show: true
                }
            },
            edgeSymbol: ['circle', 'arrow'],
            edgeSymbolSize: [4, 10],
            data: data,
            links: links,
            lineStyle: {
                normal: {
                    color: '#2f4554'
                }
            }
        }
    ]
};

Other comments [其他信息]

pissang commented 6 years ago

roam 只是针对没有坐标系和地图的图表的交互,笛卡尔坐标系的平移缩放都是通过 dataZoom 实现

yrx0823 commented 2 years ago

想用type:graph 的关系图连线有effect效果 就得用笛卡尔坐标系,这样就没法roam了