To customize the appearance of buttons in Highcharts, you can create your own SVG path by modifying the topbutton
and bottombutton
functions within
Highcharts.SVGRenderer.prototype.symbols
. Here is an example using circles:
(function(H) {
function customRoundedRect(x, y, w, h, r) {
var xStart = x + w / 2 - r,
yStart = y + h / 2 - r;
return [
['M', xStart, yStart],
// top side
['A', r, r, 0, 0, 0, xStart + 2 * r, yStart + 2 * r],
// top right corner
['A', r, r, 0, 0, 0, xStart, yStart]
];
}
H.SVGRenderer.prototype.symbols.topbutton = function(x, y, w, h, options) {
var r = (options && options.r) || 0;
return customRoundedRect(x - 1, y - 1, w, h, r);
};
H.SVGRenderer.prototype.symbols.bottombutton = function(x, y, w, h, options) {
var r = (options && options.r) || 0;
return customRoundedRect(x - 1, y - 1, w, h, r);
};
}(Highcharts));
Check out a live demo: http://jsfiddle.net/BlackLabel/hwg9up7f/
For more information, refer to the documentation here: https://www.highcharts.com/docs/extending-highcharts/extending-highcharts