cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Change background color of chart/graphs titles with Json file

Hey Mates,

 

Does anyone know how to change the background color of the titles of the carts/graphs with a json file?

SergioMontesEY_0-1633038943622.png

I'm trying to change the yellow color and the text color, but I can't find the name element or the property on the json file.

 

Thanks in advance

7 REPLIES 7
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

To change background color of chart/graphs titles, please add a visualStyles section to the JSON file to nest the formatting specifics. Here's a sample:

 

 

{
  "name": "Custom Theme",
  "dataColors": [ "#990011", "#cc1144", "#ee7799", "#eebbcc", "#cc4477", "#cc5555", "#882222", "#A30E33" ],
  "background": "#FFFFFF",
  "foreground": "#ee7799",
  "tableAccent": "#990011",
  "visualStyles": {
    "*": {
      "*": {
        "title": [
          {
            "show": true,
            "fontColor": { "solid": { "color": "#FFFFFF" } },
            "background": { "solid": { "color": "#cc4477" } }
          }
        ]
      }
    }
  }
}

 

vkkfmsft_0-1633416447001.png

 

Referencing: https://www.youtube.com/watch?v=l3389KbpEtA 

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Winniz, thanks for you answer, but for some reason, it is just applying that style for some titles, but, for the ones for the charts/graphs, it didn't work, don't know if I have to add a specific property, it's really odd. This is what I'm getting when I upload your Theme.json file:

SergioMontesEY_0-1633441259846.png

As you can see the titles are still yellow, but the other ones, are pink :(.

 

Thank you so much!

Regards,

 

Sergio Montes



VahidDM
Super User
Super User

G'day Mate,

 

If that's a header of your chart, you can change background and Font in Visualization->Format->Title:

VahidDM_0-1633048231679.png

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!

 

Anonymous
Not applicable

Hi Vahid,

 

Thank you so much for your answer, but I'm trying to find a property or the name of that element, to change it, with a json file (I'm creating a new theme). Appriciate your time. Have a good one and thanks again.

mahoneypat
Microsoft
Microsoft

You can edit it at the visual level under Title in the format options.

 

mahoneypat_0-1633047797831.png

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi Mahoneypat,

 

Thank you so much for your answer, but I'm trying to find a property or the name of that element, to change it, with a json file (I'm creating a new theme). Appriciate your time. Have a good one and thanks again.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors