How to Format column chart data labels as shown in the image, Need to format only the second bar.
The code i have tried shown below
[$('#voo-accepted-orders-graph').highcharts({
chart: {
type: 'column',
backgroundColor: '#9a97de',
minPadding: 0.08,
maxPadding: 0.08,
},
title: {
text: ''
},
legend: {
enabled: false,
},
exporting: {
enabled: false
},
credits: {
enabled: false
},
xAxis: {
tickWidth: 0,
gridLineWidth: 0,
gridLineColor: "#5c6bc0",
categories: \['accepted', 'auto-accept', 'sent to PO', 'transfers'\],
labels: {
style: {
color: '#ffffff',
fontFamily: "Avenir LT std light",
fontSize: "12px",
zIndex: 1000
}
}
},
yAxis: {
allowDecimals: false,
title: {
text: ''
},
gridLineWidth: 0,
labels: {
enabled: false
},
min: 0,
tickInterval: 20,
},
tooltip: {
pointFormat: '{series.name} <b>{point.y:,.0f}</b><br/>'
},
plotOptions: {
column: {
color: '#8381cc',
borderColor: '#8381cc',
},
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
zIndex: 10,
color: "#fff",
style: {
textShadow: false,
fontWeight: "normal",
}
}
}
},
series: \[{
name: 'orders',
data: \[200, 72, 36, 15\]
}, {
name: 'price',
data: \[90, 150, 120, 50\]
}\]
});][1]
Also 1. Need to format only the second bar. 2. Is there any possibility to get the vertical lines.
CODEPEN
If you want to change labels for just one column of data, you simply add more attributes to a particular point in that series.
Using the code in your question, I changed the first point of the "price" series so that its label is both red and bold:
For your follow-up question on adding a background behind the x-axis labels, I referred to post Highchart: Background color of Axis. Here's the code I used:
First, before you define the chart options, I've added a function to draw a rectangle behind the x-axis labels.
Next, I set some events in your chart options:
Here is the result:
You can find the working fiddle with this example here: http://jsfiddle.net/brightmatrix/0yLn5bky/
I hope this is helpful for you.