4 Replies Latest reply on Oct 18, 2018 12:46 PM by Beatrix Balogh

    Label word wrap not working for horizontal bar chart

    Beatrix Balogh

      Hi folks!

       

      I have a simple horizontal bar chart that uses a hierarchy system to show a larger Clinical Class and then breaks down the Secondary Clinical Classes within it. I pulled in the label and color for the Secondary Clinical Classes, however the text label for them refuses to text wrap, so it flows over into the other bar sections, and at the moment does not overlap other text, but will eventually do so as more data comes in.

       

      Image below and attached the sample workbook. Essentially I'm wanting the blue box text "Chronic obstructive pulmonary disease and bronchiectasis" to wrap instead of being all in one line.

       

       

       

      Thanks in advance!!

        • 1. Re: Label word wrap not working for horizontal bar chart
          Tushar  More

          So far my experience with the tool, it works well when you use text tables. A workaround is to use legend instead.

          • 2. Re: Label word wrap not working for horizontal bar chart
            Beatrix Balogh

            Hi Tushar, that works well with the example I sent, but my actual data set has hundreds of variables within Clinical Class 2, so that wouldn't work because the legend would be huge.

            Overall what I was trying to do was wrap the text and only show the highest Clinical Class 2 for each Clinical Class, so for Respiratory only show the label for the Clinical Class 2's that have the highest counts, and same for Nervous and Injury. The issue comes up when in this example Respiratory Clinical Class 2 has two labels that have the same # of counts, so their labels both show, which is what I would want, I just wouldn't want them to overlap the way they are now.

            • 3. Re: Label word wrap not working for horizontal bar chart
              swaroop.gantela

              Beatrix,

               

              This may be too round-about, but you can try calculating your own breakpoints.

              This doesn't take into account all situations, but maybe it can give an idea.

               

              The idea is that if the text extends over some predeteremined length,

              then break at a midpoint space.

               

              -count the number of spaces:

                   LEN([Clinical Class 2])-LEN(REPLACE([Clinical Class 2]," ",""))

               

              -find the middle number of spaces:

                   ROUND([countSpaces]/2,0)

               

              -first part of string;

              IF LEN([Clinical Class 2])<40  // I set length arbitrarily at 40

              THEN [Clinical Class 2]

              ELSE MID([Clinical Class 2],1,FINDNTH([Clinical Class 2]," ",[BreakPoint]))

              END

               

              -second part of string

              IF LEN([Clinical Class 2])<40

              THEN ""

              ELSE MID([Clinical Class 2],FINDNTH([Clinical Class 2]," ",[BreakPoint]),LEN([Clinical Class 2]))

              END

               

              Then both can be placed on the Label Shelf.

               

              I set the length arbitrarily at 40 but you can maybe make a calculated field

              to determine the best length.

               

              There are many other factors not taken into account here:

              dashboard size, actual size of the bar, etc.

              There are probably calculated fields that could further refine.

               

              Please see workbook v18.1 attached in the Forum Thread.

              284982wrap.png

              1 of 1 people found this helpful
              • 4. Re: Label word wrap not working for horizontal bar chart
                Beatrix Balogh

                That actually works pretty well! I'll play around a bit with seeing if I can split the label into 3 separate lines as well. Thank you!!