My stacked Horizontal Bar labelsAbove aren't appearing correctly

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by John S on 4th June 2016

I'm trying to create a horizontal "range" bar chart. I need each horizontal bar to display a single color showing range between two numbers.

I also want use labelAboveSpecific text to show label text to the right of each bar.

Some items have *no* range, and I'd like to display that with a blank bar, and the appropriate label, with the label appearing in the horizontal center of the chart for that item.

The problem I'm having a problem is with labels: The last item (in the example linked to below) doesn't display the label ("Boss TU-2 (438-445)"), but rather, displays the sum of the first and second values in the data array for that item.

So, the label for the third item is showing up on the chart as "145" rather than "Boss TU-2 (438-445)".

I have the chart working locally (except for this label issue). Here is the jsfiddle with the Javascript (but I couldn't get it to use your js libraries).

Many thanks.

Posted by Richard on 4th June 2016
Hi there,

I think it's because the stacked HBar doesn't account for labelsAbove correctly - so you need to specify a blank label for the segments of the bars that aren't at the end of the bar. Like this:

Posted by John S on 4th June 2016
That did it. Thanks much for the software and your help.


Add a reply

« Back to message list