dataLabels
Configuration Structure
dataLabels: {}enabled
trueTo determine whether to show dataLabels or not
enabledOnSeries
undefinedAllows showing series only on specific series in a multi-series chart. For eg., if you have a line and a column chart, you can show dataLabels only on the line chart by specifying it's index in this array property.
formatter
The formatter function allows you to modify the value before displaying Example:
formatter: function(value, { seriesIndex, dataPointIndex, w }) {
return w.config.series[seriesIndex].name + ": " + value
}
In the code above, seriesIndex is useful in multi-series chart, while dataPointIndex is the index of data-point in that series. w is an object consisting all globals and configuration which can be utilized the way mentioned in the above code.
textAnchor
'middle'The alignment of text relative to dataLabel's drawing position
Accepted values
- start
- middle
- end
distributed
falseSimilar to plotOptions.bar.distributed, this option makes each data-label discrete. So, when you provide an array of colors in datalabels.style.colors, the index in the colors array correlates with individual data-label index of all series.
offsetX
0Sets the left offset for dataLabels
offsetY
0Sets the top offset for dataLabels
style
fontSize
'12px'FontSize for the label
fontFamily
undefinedFontFamily for the label
fontWeight
600Font weight for the label. Can be String ('bold') or number (400/500)
colors
undefinedForeColors for the dataLabels. Accepts an array of string colors (['#333', '#999']) or an array of functions ([function(opts) { return '#333' }]) (Each index in the array corresponds to the series).
enabled
trueShould draw a background rectangle around the label
foreColor
'#fff'Color of the label when background is enabled. This will override the colors above in style key.
borderRadius
2Border radius of the background rect.
borderWidth
1Border width of the background rect.
borderColor
'#fff'Border color of the background rect.
opacity
0.9Opacity of the background color.
dropShadow
enabled
trueEnable a dropshadow for dataLabels background
top
1Set top offset for shadow
left
1Set left offset for shadow
blur
1Set blur distance for shadow
color
'#000'Set color of the shadow
opacity
0.9Set the opacity of shadow.
dropShadow
enabled
trueEnable a text dropshadow
top
1Set top offset for text shadow
left
1Set left offset for text shadow
blur
1Set blur distance for text shadow
color
'#000'Set color of the text shadow
opacity
0.9Set the opacity of text shadow.