Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

donutChart Theming

Hello,

 

What is the reference name  i.e the name to use in the json theme file for the property % decimal places of the card name labels of the donutChart visual ?

 

Thank you!

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

 

That should be labelPrecision. Here is my sample code for your reference.

{
   "name":"My Theme",
   "visualStyles":{
      "*":{
         "*":{
            "*":[
               {
                  "color":{
                     "solid":{

                     }
                  }
               }
            ]
         }
      },
      "clusteredColumnChart":{
         "*":{
            "valueAxis":[
               {
                  "show":true
               }
            ]
         }
      },
      "card":{
         "*":{
            "labels":[
               {
                  "show":true,
                  "color":{
                     "solid":{
                        "color":"#123456"
                     }
                  },
                  "labelPrecision":2,
                  "fontSize":12,
                  "fontFamily":"Tahoma"
               }
            ]
         }
      }
   }
}

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @Anonymous ,

 

Attached my pbix.

json.PNG

{
   "name":"My Theme",
   "visualStyles":{
      "*":{
         "*":{
            "*":[
               {
                  "color":{
                     "solid":{

                     }
                  }
               }
            ]
         }
      },
      "clusteredColumnChart":{
         "*":{
            "valueAxis":[
               {
                  "show":true
               }
            ]
         }
      },
      "card":{
         "*":{
            "labels":[
               {
                  "show":true,
                  "color":{
                     "solid":{
                        "color":"#FF0025"
                     }
                  },
                  "labelPrecision":2,
                  "fontSize":12,
                  "fontFamily":"Tahoma"
               }
            ]
         }
      }
   }
}

 

 

Btw, could you please share your code to me?

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Dear @v-frfei-msft,

My problem is mainly with the donut Chart ! Other visuals work quite well as you stated.
Here is my json file.

 

{
    "name": "amTheme",
    "good": "#00d44a",
    "neutral": "#a2a3a2",
    "bad": "#D40008",
    "maximum": "#118DFF",
    "center": "#D9B300",
    "minimum": "#DEEFFF",
    "null": "#FF7F48",
    "textClasses": {
        "smallLightLabel": {
            "fontSize": 8,
            "color": "#394668"
        },
        "smallLabel": {
            "fontSize": 9,
            "color": "#394668",
            "fontFace": "wf_segoe-ui_bold"
        }
    },
    "visualStyles": {
        
        "page": {
            "*": {
                "background": [{
                        "color": {"solid": {"color": "#E4E7ED"}},
                        "transparency": 0
                }],
                "outspace": [{
                        "color": {"solid": {"color": "#E4E7ED"}},
                        "transparency": 0
                }]
            }
        },
        "donutChart": {
            "*": {
                "legend": [{
					"show": true,
					"position": "Top",
					"showTitle": false,
					"titleText": "",
					"labelColor": { "solid": { "color": "#394668"}},
					"fontFamily": "wf_segoe-ui_bold",
					"fontSize": 9,
					"legendMarkerRendering": "markerOnly",
                    "matchLineColor": true,
                    "circleDefaultIcon" : true
                }],
                "labels": [{
                    "show": true,
                    "labelStyle": "Category, percent of total",
                    "color": { "solid": { "color": "#394668"}},
                    "labelDisplayUnits": { "expr":{ "Literal":{ "Value":"1D"}}},
                    "labelPrecision": "2",
                    "fontSize": 8,
                    "fontFamily": "Segoe UI",
                    "position": "outside"
                }],	
                "slices": [{
					"innerRadiusRatio": 60
                }],
                "title": [{
                    "show": false,
                    "titleWrap": true,
                    "fontColor": { "solid": { "color": "#394668" } },
                    "background": { "solid": { "color": "" } },
                    "alignment": "Left",
                    "fontSize": 12,
                    "fontFamily": "wf_segoe-ui_bold"
                }],
                "background": [{
                    "show":true,
                    "color": { "solid": { "color": "#FFFFFF"}},
                    "transparency": 0
                }],
               "border": [{
                   "show": true,
                   "radius": 3,
                   "color": { "solid": { "color": "#FFFFFF" } }
               }],
               "visualTooltip": [{
                   "type": "Default",
                   "fontFamily": "Segoe UI",
                   "fontSize": 8,
                   "valueFontColor": {"solid": {"color": "#FFFFFF"}},
                   "titleFontColor": {"solid": {"color": "#FFFFFF"}},
                   "transparency": 0,
                   "background": {"solid": {"color": "#394668"}}
               }],
               "visualHeader": [{
                   "show": false
               }]
            }
        }
        
    }    	
}

 

Anonymous
Not applicable

Hey @v-frfei-msft ,

 

I have tried using labelPrecision but it didn't work! Any idea about what could be the reason ??

I made sure to press revert to default, but nothing changed!!

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.