apache / echarts

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

这个fixed属性,为什么设置后报错找不到这个属性呢?我下载的也是4.0.2版本的echart啊(mac版,谷歌浏览器) #7645

Closed ys278099744 closed 3 years ago

ys278099744 commented 6 years ago
var option = {
        legend: {
            data: []
        },
        tooltip: {
            show: true,
            trigger: 'item',
            formatter: function (param, ticket, callback) {
                if ("node" == param.dataType) {

                } else if ("edge" == param.dataType) {
                    return param.data['linkText']
                }
            }
        },
        series: [{
            type: 'graph',
            edgeSymbol: ['arrow'],
            layout:'force',
            animation: false,
            label: {
                normal: {
                    position: 'right',
                    formatter: '{b}'
                }
            },
            draggable: true,
            roam:true,
            data: [{
                id:'5',
                name: 'n1',
                value: 10,
                category: 3,
                fixed:true
            }, {
                id:'7',
                name: 'n2',
                value: 20,
                category: 2,
                fixed:true

            },{
                id:'8',
                name: 'n2',
                value: 20,
                category: 3,
                fixed:true
            }
            ],
            categories: [
                {
                    name: "HTMLElement",
                    keyword: { },
                    base: "HTMLElement"
                },
                {
                    name: "WebGL",
                    keyword: { },
                    base: "WebGLRenderingContext"
                },
                {
                    name: "SVG",
                    keyword: { },
                    base: "SVGElement"
                },
                {
                    name: "CSS",
                    keyword: { },
                    base: "CSSRule"
                },
                {
                    name: "Other",
                    keyword: { }
                }
            ],
            // force: {
            //     // initLayout: 'circular'
            //     // repulsion: 20,
            //     edgeLength: 100,
            //     repulsion: 20,
            //     gravity: 0.2
            // },
            edges: [
                {source: '5',target: '7',linkText:'5>7'},
                {source: '7', target: '8',linkText:'7>8'},
                {source: '8', target: '7',linkText:'8>7'}

            ]
        }]
    };
cxw2014 commented 5 years ago

@ys278099744 我也遇到了这个问题,请问你解决了吗

ys278099744 commented 5 years ago

@ys278099744 我也遇到了这个问题,请问你解决了吗

我当时是因为版本问题,我用的 "echarts-for-react": "2.0.6"好了,

ys278099744 commented 5 years ago

@ys278099744 我也遇到了这个问题,请问你解决了吗

还有那个data下面的fixed属性第一次渲染不要设置,要等你真正拖动的时候再去设置他

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!