I want to add a data label to specific point in the 'Area' chart. I'm using 'Highchart' for making graph. I want a data label in chart design as following image. What should I try ? I tried dataLabel defined in 'line' chart but it applies dataLabel to each point in the chart. I want it to be applied for specific point. Also, it should not show value of that point as a dataLabel but it should show series.name on that point.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
For the relevant point in your data use the object notation and enabled data labels. You can use format
and formatter
to display the desired information.
Example of your series would be:
series: [{
name: 'My series name',
data: [5, 10, 30, 100, 200, 300, 600,
{
y: 900,
dataLabels: {
enabled: true,
format: '{series.name}'
}
},
700, 400, 100]
}]
Or see this more elaborate JSFiddle example.