Reputation: 567
I'm trying to get highcharts top border to curve inside as such
on a column/cylinder like below. I tried to play around with the
borderRadius
in the css but nothing really worked for me, the closes I got was something like this which is not an option
jsfiddle is here for cyllinder
and here for column. Both are fine for my use case. https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/column-borderradius/
Upvotes: 0
Views: 107
Reputation: 39139
That is not possible by using defualt Highcharts API, but there is a possibility to add an extension by wrapping prototype functions. You can wrap drawPoints
method to change column shape type from rect
to path
with curved top border.
(function(H) {
H.wrap(H.seriesTypes.column.prototype, 'drawPoints', function(proceed) {
this.points.forEach(function(point) {
var sArgs = point.shapeArgs;
point.shapeType = 'path';
point.shapeArgs = {
'd': [
'M', sArgs.x, sArgs.y,
'Q', sArgs.x + sArgs.width / 2,
sArgs.y + sArgs.width / 2,
sArgs.x + sArgs.width, sArgs.y,
'L', sArgs.x + sArgs.width, sArgs.y + sArgs.height,
sArgs.x, sArgs.y + sArgs.height, 'z'
]
}
});
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
});
}(Highcharts));
Live demo: http://jsfiddle.net/BlackLabel/as6y1uhn/
API Reference: https://api.highcharts.com/class-reference/Highcharts#.wrap
Docs: https://www.highcharts.com/docs/extending-highcharts
Upvotes: 1