Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Sliding legend

Hi everyone,

I saw sliding legend in one of the visuals, which are built in Power BI desktop.

How this feature can be recreated in custom visual?

Regards,

Yerkhan

19 Replies

  • dm-p's avatar
    dm-p
    Super User

    Hi Anonymous,

    Do you have an example of where you saw it, or what you are trying to achieve? Is it a particular custom visual? If so, which one? If we can get an idea of what you're aiming for then it might be possible to provide more targeted help.

    Thanks,

    Daniel

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi dm-p ,

       

      I meant this type of legend, as in this visual:

      Legend in this visual slides to right, in case of large legend.

      I wanted to use this type of legend in my custom visual.

       

      Regards,

      Yerkhan

      • dm-p's avatar
        dm-p
        Super User

        Hi Anonymous, and thanks for clarifying :)

        Assuming you're using createLegend in powerbi-visuals-utils-chartutils to manage the creation of your legend, you need to set the isScrollable property to true.

        If your legend exceeds the area the function reserves for it in the visual viewport, then you'll get the button to scroll to see the additional items.

        Good luck!

        Daniel

  • after a certain amount of items in the legend the legend becomes scrollable