Incubator-echarts: 关于markPoint.symbol怎么用 'image://url' 设置为图片

Created on 6 Jul 2016  ·  11Comments  ·  Source: apache/incubator-echarts

问题简述 (One-line summary)

参照echarts3.0官网上面说的可以用‘image://url’自定义图片,均失败

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):3.0
  • 浏览器类型和版本 (Browser version):chrome
  • 操作系统类型和版本 (OS Version):window

    重现步骤 (Steps to reproduce)

1.symbol: 'image://https://www.w3.org/TR/SVG/images/paths/cubic01.svg'
2.

期望结果 (Expected behaviour)

symbol为自己的图片

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

不知道 网上也没找到相关解答

ECharts配置项 (ECharts option)

option = {
            series: [
                {
                    type: 'line',
                    name: 'price',
                    data: data.price,
                    lineStyle: {
                        normal: {
                            type: 'solid',
                            color: '#0caee6'
                        }
                    }
                },
                {
                    type: 'line',
                    name: 'mark',
                    data: data.data,
                    lineStyle: {
                        normal: {
                            type: 'dashed',
                            color: '#0caee6',
                            opacity: 0
                        }
                    },
                    markPoint: {
                        symbol: 'circle',
                        //symbol: 'image://https://www.w3.org/TR/SVG/images/paths/cubic01.svg',
                        symbolSize:10,
                        //symbolSize: [150, 50],
                        //symbolOffset: [0, -50],
                        data: data.title,
                        label: {
                            normal: {
                                show: false,
                                textStyle: {
                                    color: '#dcdcdc'
                                }
                                //formatter: function (val) {
                                //    return '';
                                //    //return val.data.time + '\r\n' + val.data.title.substr(0, 10) + '...';
                                //}
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: '#eecb57',
                                borderColor: '#e0554e',
                                borderWidth: 1
                            },
                            emphasis:{
                                color: '#e0554e',
                                borderColor: '#e0554e',
                                borderWidth: 4
                            }
                        },
                        areaStyle:{
                            normal:{
                                color: 'blue',
                                shadowColor: 'rgba(0, 0, 0, 0.5)',
                                shadowBlur: 5
                            }
                        }
                    }
                }
            ]

}

其他信息 (Other comments)

Most helpful comment

qq20160706-0

All 11 comments

对 svg 图片的支持可能有问题,建议用 png 或者 jpg

png也不行 能否给一个实例

能否详细说明下不行是怎么样不行,我刚试了下你给的 svg 也是可以的

symbol: 'image://https://www.w3.org/TR/SVG/images/paths/cubic01.svg'
我这样写是否是正确的?如果没错的话,就是出不来图片效果,不知道什么原因

能否把你的用法贴出来 让我看一下

这个url可以是本地相对路径的图片吗

出不来图片可能是因为 symbolSize 太小,这个图片里面的元素都缩小到看不见了

我把symbolSize设置成和这个sug大小一样 也没出来

qq20160706-0

为啥用下面的方式不可以呢

symbol: 'path://https://www.w3.org/TR/SVG/images/paths/cubic01.svg'

怎么设置symbol呢

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marine1ly picture marine1ly  ·  3Comments

kirazxyun picture kirazxyun  ·  3Comments

771752687 picture 771752687  ·  3Comments

jarben picture jarben  ·  3Comments

Zendic picture Zendic  ·  3Comments