We have requirement for line chart as below. We are using highcharts. Our requirement is that chart should display series name at the end of line as displayed in below images. <
As an alternative to the renderer()
, I find it convenient to use the dataLabels
for this purpose.
The idea being to disable dataLabels
in the plotOptions
, but define the position and format anyway.
Then enable the dataLabels
for the last point in each series' data array.
Example:
plotOptions: {
series: {
dataLabels: {
enabled: false,
crop: false,
overflow: 'none',
align: 'left',
verticalAlign: 'middle',
formatter: function() {
return ''+this.series.name+'';
}
}
}
}
Fiddle:
Output example: