score:8
Accepted answer
Use this highcharts-border-radius plugin.
$(function() {
'use strict';
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
H.wrap(H.seriesTypes.column.prototype, 'translate', function(proceed) {
const options = this.options;
const topMargin = options.topMargin || 0;
const bottomMargin = options.bottomMargin || 0;
proceed.call(this);
H.each(this.points, function(point) {
if (options.borderRadiusTopLeft || options.borderRadiusTopRight || options.borderRadiusBottomRight || options.borderRadiusBottomLeft) {
const w = point.shapeArgs.width;
const h = point.shapeArgs.height;
const x = point.shapeArgs.x;
const y = point.shapeArgs.y;
let radiusTopLeft = H.relativeLength(options.borderRadiusTopLeft || 0, w);
let radiusTopRight = H.relativeLength(options.borderRadiusTopRight || 0, w);
let radiusBottomRight = H.relativeLength(options.borderRadiusBottomRight || 0, w);
let radiusBottomLeft = H.relativeLength(options.borderRadiusBottomLeft || 0, w);
const maxR = Math.min(w, h) / 2
radiusTopLeft = radiusTopLeft > maxR ? maxR : radiusTopLeft;
radiusTopRight = radiusTopRight > maxR ? maxR : radiusTopRight;
radiusBottomRight = radiusBottomRight > maxR ? maxR : radiusBottomRight;
radiusBottomLeft = radiusBottomLeft > maxR ? maxR : radiusBottomLeft;
point.dlBox = point.shapeArgs;
point.shapeType = 'path';
point.shapeArgs = {
d: [
'M', x + radiusTopLeft, y + topMargin,
'L', x + w - radiusTopRight, y + topMargin,
'C', x + w - radiusTopRight / 2, y, x + w, y + radiusTopRight / 2, x + w, y + radiusTopRight,
'L', x + w, y + h - radiusBottomRight,
'C', x + w, y + h - radiusBottomRight / 2, x + w - radiusBottomRight / 2, y + h, x + w - radiusBottomRight, y + h + bottomMargin,
'L', x + radiusBottomLeft, y + h + bottomMargin,
'C', x + radiusBottomLeft / 2, y + h, x, y + h - radiusBottomLeft / 2, x, y + h - radiusBottomLeft,
'L', x, y + radiusTopLeft,
'C', x, y + radiusTopLeft / 2, x + radiusTopLeft / 2, y, x + radiusTopLeft, y,
'Z'
]
};
}
});
});
}(Highcharts));
}));
Highcharts.chart('container', {
chart: {
type: 'column'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
plotOptions: {
column: {
grouping: false,
borderRadiusTopLeft: 10,
borderRadiusTopRight: 10
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
Fiddle demo
score:2
Just in case I ever wonder again:
clip-path: inset(0% 0% -2px 0% round 2px);
This adds 2px border radius to the top of that column. (apply to these rects)
Source: stackoverflow.com
Related Query
- How to apply borderRadius only for top side of Column or Bar in Highchart
- Highcharts: How to move the column bar to the left most side when there is only one point in drilldown
- How to know information about the clicked bar in highchart column r shiny plot
- How to make 1st bar selected in column highchart on page load?
- How do I open a new window / tab by clicking on a column / bar within a Highchart graph?
- How Can we display blocked area for particular timeline in horizontal bar in gantt highchart
- How can I apply a radial gradient for 3d but ONLY for particular charts?
- How to show the value in top of each column bar | Hightcharts | Vue-chartkick | Cube Js
- How to detect multiple cliks in a bar in highchart column r shiny plot
- Highcharts Chart Bar - How can I display in the chart, only one column from my HTML table?
- How to position Highcharts tooltip on top of bar or at 0 line of Y-axis for negative value
- how to truncate the stackLabels on yaxis for a stacked Grouped column highchart
- How to set different colors for bars based on value in Highchart bar chart?
- How to specific name (tooltip) for each bar in Highchart
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- How to get Highchart plots plotted only for starting and ending points
- Align second scatter series to the side similar to how column and bar charts do using HighCharts
- how to avail bg color for every bar in highchart
- When there is a plotband and a plotline emerging from yAxis how to set a particular width for plotband only in highchart
- How can i reduce gap between legend and chart in highchart of type column where legend is aligned at top without reducing height of chart?
- Highchart specific width stack column bar graph
- How to make stacked column graph to show total data value on top
- How to break highchart bars for extreme values
- Setting variable column size in bar highchart (Rshiny)
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- How to set the x value for High Charts error bar
- How can I prevent my HighChart bar chart from being inverted?
- How to add a background image (pattern) to highchart column graph?
- How to add box shadow for highchart chart?
- How to place x axis labels on top of horizontal bar chart
More Query from same tag
- How to make a highchart's Tree Map chart fill the entire page without overflowing
- Highcharts x axis label text wrapping lost on setting label step
- Adding flags to highcharts (not highstock) dynamically
- Highcharts chart categories not displaying correctly
- Highstock charts: Multiple x axis rotates the view
- Highcharts with Rails
- Angular.js, Highcharts, Phantomjs PDF printer - graphs not showing up
- Show label of stacked columns only on hover (and also the previous and next column)
- Highcharts 3D cylinder wiht ReactJS
- Data from MongoDB results with empty Highcharts graph
- Updating a point in a line chart when data grouping is in effect
- Highchart: Line at bottom-border appear
- highchart : Add the series name on the column chart
- HighChart World Map not rendering in Angular 7
- Highstocks update date in rangeSelector
- Dynamically set dragmax using dragable points for Highcharts
- HighCharts specific chart
- Highcharts remove zoom feature
- how to display array of objects in High stock charts
- Highcharts - apply gradient on custom colors
- Highmap Geojson of China cities
- highchart scatter with 24 hours time on y axis and the day of the transaction on x axis
- How can I reset the styles given to series in Highcharts?
- Highcharts menus bottom into right side of the graph
- angular2-highcharts error: “Chart is unknown chart type”
- Display label stack Label in Highcharts
- Scraping data from Highcharts using selenium
- HighCharts wrong xAxis label
- display two charts with IE
- Highcharts data grouping method for objects