Skip to main content
Question

Label points for Stacked Bar chart in Views - Not able to align properly

  • May 20, 2023
  • 1 reply
  • 5 views

Hi team,

 

I am trying to create a Stacked Bar chart. I would like to see label points aligned according the stacked bar. Instead, I see that they are not properly aligned.

FYI screenshot with YAML and visualization for reference.

 

image.png 

image.png 

I am also including screenshot below (expected behavior of chart)

image 

 

This works the same with split by too. Therefore, kindly requesting to guide me with relevant code snippet to achieve the above request.

 

Thank you :)

 

Best Regards,

Shravya B

1 reply

Forum|alt.badge.img+4
  • Celonaut
  • 3 replies
  • February 8, 2024

Dear Shravya, Thank you for your question. 

In order to answer your question, I tried recreating a similar chart to yours, however I did not run into the problem you are having with the alignment of the labels. The labels are usually automatically aligned. However, I would recommend you to try out the following suggestions to try to fix your chart: 

  1. Try to simplify your chart by starting over with creating it in the Visual Editor, include one chart layer for each of your y axis and play around with the order of the chart layers to get the desired result before using the “Stack by” option.
  2. In YAML code, include “align: start/middle/end” after the code “labels:true”

 

If the issue persists, please send me a screenshot of your visual editor as well. 

 

Thank you and hope this helps.