Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Charts: DataLabels
Hello,
is it possible to create datalabels on a DataSeriesItem with low and high set and display only the high value?
I've want to create a callout at the high point (end of the bar)
Thanks in advance.
Hi,
I don't think there's API for enabling datalabels on high or low only. I did a quick test and noticed that you can create a complex datalabel formatter like this:
PlotOptionsColumnrange columnRange = new PlotOptionsColumnrange();
columnRange.getDataLabels().setEnabled(true);
columnRange.getDataLabels().setFormatter("return (this.y === this.point.high)?this.y:''");
That will only show data for label in high value.
You can also make the formatter more complex by adding a whole javascript function like in the following example:
columnRange.getDataLabels().setFormatter("function() { if (this.y === this.point.high) { return this.y ; }else{ return ''; } }");
Hope this helps,
Guille
Guillermo Alvarez: Hi,
I don't think there's API for enabling datalabels on high or low only. I did a quick test and noticed that you can create a complex datalabel formatter like this:
PlotOptionsColumnrange columnRange = new PlotOptionsColumnrange(); columnRange.getDataLabels().setEnabled(true); columnRange.getDataLabels().setFormatter("return (this.y === this.point.high)?this.y:''");
That will only show data for label in high value.
You can also make the formatter more complex by adding a whole javascript function like in the following example:
columnRange.getDataLabels().setFormatter("function() { if (this.y === this.point.high) { return this.y ; }else{ return ''; } }");
Hope this helps,
Guille
Thank you so much. This solved my problem.