I want to give 5 px shadow in right side of the bar. Is it possible?
Asked
Active
Viewed 999 times
5

ali
- 557
- 2
- 13
-
1check the docs: http://api.highcharts.com/highcharts#plotOptions.column.shadow – jlbriggs May 13 '16 at 12:44
-
That is a box shadow, but i need inner shadow in the bars as you can see in the image. – ali May 13 '16 at 14:14
1 Answers
4
You should use the Renderer which allows to add custom paths in chart. Knowing that, catch the load event and iterate on each series point, adding line in right side.
chart: {
type: 'column',
events: {
load: function() {
var chart = this,
series = chart.series,
each = Highcharts.each,
r = chart.renderer,
borderWidth = 2,
x,y;
each(series, function(s, i) {
each(s.data, function(p, j) {
x = p.plotX + chart.plotLeft + (p.pointWidth / 2);
y = p.plotY + chart.plotTop + borderWidth;
r.path(['M', x, y, 'L', x, y + p.shapeArgs.height])
.attr({
zIndex: 10,
'stroke-width': borderWidth,
'stroke': 'gray'
})
.add()
});
});
}
}
},
Example: - http://jsfiddle.net/2reombm7/

Sebastian Bochan
- 37,348
- 3
- 49
- 75
-
Awesome one. Thank you so much. Can you please mark this question up as a useful, someone marked it down :( – ali May 17 '16 at 06:54