echarts-x的addMark类操作

依石听海 发布于 2015/05/13 10:01
阅读 543
收藏 0

@pissang 你好,想跟你请教个问题:echarts-x的现在这个版本支持addMarkLine和addMarkPoint操作么?下面是我的代码,初始化之前的加入的markPoint可以显示,初始化之后用addMarkPoint加入不成功.是不是我写的代码有问题?

require.config({
                paths: {
                    'echarts': 'dep/echarts/build/source',
                    'echarts-x': 'dep/echarts-x/build/source'
                }
            });
            require([
                'echarts',
                'echarts-x',
                'echarts/chart/map',
                'echarts-x/chart/map3d'
            ], function(ec) {
                var myChart = ec.init(document.getElementById('chart'));
                var option = {
                    title: {
                        text: ''
                    },
                    series: [{
                            type: 'map3d',
                            // Empty data
                            name: "'test",
                            mapType: 'world',
                            baseLayer: {
                                backgroundColor: '',
                                backgroundImage: 'asset/earth.jpg'
                            },
                            itemStyle: {
                                normal: {
                                    borderWidth: 1,
                                    borderColor: 'yellow',
                                    areaStyle: {color: 'rgba(0,0,0,0)'}

                                },
                            },
                            markPoint: {
                                large: true,
                                effect: {
                                    show: true,
                                    shadowBlur: 0.1
                                },
                                symbol: 'circle',
                                clickable: 'true',
                                data: [{
                                        name: 'AAA',
                                        geoCoord: [116.46, 0],
                                        value: 8,
                                        distance: 1,
                                        itemStyle: {
                                            normal: {
                                                color: '#000',
                                                label: {
                                                    show: true
                                                }
                                            }
                                        },
                                        symbolSize: 5
                                    }

                                ]
                            },
                            data: [{}],
                        }]
                };
                myChart.setOption(option);
                myChart.addMarkPoint(0, {
                    large: true,
                    effect: {
                        show: true,
                        shadowBlur: 0.1
                    },
                    symbol: 'circle',
                    clickable: 'true',
                    data: [{
                            name: 'bbb',
                            geoCoord: [1130, 0],
                            value: 8,
                            distance: 2,
                            itemStyle: {
                                normal: {
                                    color: '#000',
                                    label: {
                                        show: true
                                    }
                                }
                            },
                            symbolSize: 10
                        }

                    ]
                });

            });



加载中
返回顶部
顶部