In Apache Echarts I want to add a custom button to the toolbox. According to the examples and documentation it must be done in this way. But nothing shows up.
toolbox: {
right: '20%',
feature: {
dataZoom: {},
saveAsImage: {},
magicType: {},
myCustBut:{
show: true,
title: 'test option',
icon: 'path://"../images/Europa.png"', // tried different options here
onclick: function() {alert("Test")}
}
}
},
What am I missing here?
2
Answers
The icon property was wrong. In my case this had to be:
That did the trick.
It seems like the
icon
property needs to contain a valid input for anything to show up.The documentation states that valid inputs are either an image url (not a lokal path) prefixed with
image://
or an svg path prefixed withpath://
.Example: