Working with data labels
Data labels show the value associated with each series in the chart plot area.
To enable or disable data labels
- Go to Customize > Basic > Data labels
- Data labels are visible if the checkbox next to visibility is On and checked, and they are not visible if the checkbox is unchecked and off.
How to place data labels inside a series
- Go to Customize > Advanced > Plot options > Series > Data Labels 1
- Check the checkbox next to Inside to move data labels inside the series
- You can also position the labels in using the options in the dropdown next to Align. Selecting Right moves the data labels to the right side of the bar.
Add a non-numerical value to a data label
Adding a descriptor to the data labels is a good and clear way to define the values for your reader.
Here is a chart where data labels are enabled but not defined in the chart plot area.
Notice in this version of the chart, the word 'days' is attached to the data label in the top-most bar, indicating the values are measured in days.
Try it yourself:
- Launch the chart wizard and select a bar chart
- Add your data. Feel free to use this example data.
- Add a title and a source
- Click continue in editor
- Change the direction of the dumbells at chart type specific > direction horizontal
- Remove the legend at Customize > Basic > Legend > Visibility Off
- Remove the x-axis at Customize > Advanced > y Axis 1 > Visible Off
- Go to Data panel and add 'days' in cell C2
- Click Label in the chart controller and select Column C
- Go to Customize > Basic > Data labels > Label format and enter the following {point.y} {point.label}
Show Last label only
It's possible to show last label only by using some custom code
Here's an example:
The custom code for this chart looks as follows:
Highcharts.merge(true, options, { chart: { events: { load: function() { this.series.forEach(function(series) { series.points[series.points.length - 1].update({ dataLabels: { enabled: true } }); }); } } } });