参照echarts3.0官网上面说的可以用‘image://url’自定义图片,均失败
1.symbol: 'image://https://www.w3.org/TR/SVG/images/paths/cubic01.svg'
2.
symbol为自己的图片
不知道 网上也没找到相关解答
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
}
}
}
}
]
}
对 svg 图片的支持可能有问题,建议用 png 或者 jpg
png也不行 能否给一个实例
能否详细说明下不行是怎么样不行,我刚试了下你给的 svg 也是可以的
symbol: 'image://https://www.w3.org/TR/SVG/images/paths/cubic01.svg'
我这样写是否是正确的?如果没错的话,就是出不来图片效果,不知道什么原因
能否把你的用法贴出来 让我看一下
这个url可以是本地相对路径的图片吗
出不来图片可能是因为 symbolSize 太小,这个图片里面的元素都缩小到看不见了
我把symbolSize设置成和这个sug大小一样 也没出来

为啥用下面的方式不可以呢
symbol: 'path://https://www.w3.org/TR/SVG/images/paths/cubic01.svg'
怎么设置symbol呢
Most helpful comment