cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
optimusprime Regular Visitor
Regular Visitor

Custom Visual displayUnits drop down menu

Hi I am making my custom visual and need the display units drop down menu.....I suspect this is part of power bi utility that was packaged in?  but I cannot find any documentation.  Can anyone help?  Thanks.

2019_07_09_08_10_35_Window.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
dm-p Established Member
Established Member

Re: Custom Visual displayUnits drop down menu

Hi @optimusprime 

Use a type in your capabilities.json as follows:

"type": {
    "formatting": {
        "labelDisplayUnits": true
    }
}

The corresponding class property in your settings.ts will be of type number, as the list value will pass in a number a valueFormatter can use in the value parameter of the ValueFormatterOptions.

Here's some examples from one of my custom visuals (we're looking at the labelDisplayUnits object):

Hopefully this gets you moving!

Daniel

 

EDIT: the formatting type also has support for fontSize and alignment, values which will add selectors for font size and graphics for left/centre/right alignment as in the properties pane. Here's the section of the JSON schema for capabilities, which documents the formatting object type.

DOUBLE EDIT: looks like fontFamily was added a while back, too; that'll be worth exploring at some point...

View solution in original post

3 REPLIES 3
Highlighted
dm-p Established Member
Established Member

Re: Custom Visual displayUnits drop down menu

Hi @optimusprime 

Use a type in your capabilities.json as follows:

"type": {
    "formatting": {
        "labelDisplayUnits": true
    }
}

The corresponding class property in your settings.ts will be of type number, as the list value will pass in a number a valueFormatter can use in the value parameter of the ValueFormatterOptions.

Here's some examples from one of my custom visuals (we're looking at the labelDisplayUnits object):

Hopefully this gets you moving!

Daniel

 

EDIT: the formatting type also has support for fontSize and alignment, values which will add selectors for font size and graphics for left/centre/right alignment as in the properties pane. Here's the section of the JSON schema for capabilities, which documents the formatting object type.

DOUBLE EDIT: looks like fontFamily was added a while back, too; that'll be worth exploring at some point...

View solution in original post

optimusprime Regular Visitor
Regular Visitor

Re: Custom Visual displayUnits drop down menu

@dm-p  Thank you so much for your help!  Every time your suggestions/tutorial guided us to solution.  We just made our first custom visual KPI card.

Thank you!

 

 

dm-p Established Member
Established Member

Re: Custom Visual displayUnits drop down menu

Hi @optimusprime - that's great to hear! Onwards and upwards! 🙂

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Top Kudoed Authors
Users Online
Currently online: 284 members 3,251 guests
Please welcome our newest community members: