satish ganai
satish ganai

Reputation: 105

Apply different different data colors to different charts in power bi theme creation

I am using PowerBi February release.

I am trying to create custom theme (.json file). I want to have different data colors for different charts and not the global/common data colors for all charts.

Suppose for line chart colors are "red,green,blue" then for pie chart colors are different, lets say "yellow,grey,purple".

Can you please suggest how to create a theme based on above requirement.

Thanks in advance

Upvotes: 2

Views: 6564

Answers (1)

Taterhead
Taterhead

Reputation: 5951

Currently, this is not possible to create a custom theme that pre-assigns each color to a bar or piece of a pie chart. You can for KPI and some of the other visuals, but not pie or bar (aka stacked column chart)

The current workaround is very easy though. Follow these steps:

1) As suggested by this blog, create a custom theme with your desired colors. Using this online tool, I was able to make a minimum theme file from your requirements:

{
    "name":"MyTheme1",
    "dataColors":["#ff5624", "#21ff13", "#0009db", "#fff780", "#d3d3d3", "#7d00b6"]
}

2) Save this as yourtheme.json and import the file in the Ribbon using Themes->Switch Theme->Import Theme

3) Then you would need to go to the bar chart and pie visual and assign the colors individually:

  • For the Pie Chart - click the paint roller found in the visualizations pane and expand Data Colors. Then assign the color to the values for each pie piece. (see image for the colors from your theme.)

enter image description here

  • For bar chart (aka stacked column chart) click the paint roller found in the visualizations pane and expand Data Colors. Then set the Show All setting to On. Then assign the color to the values for each bar.

The image below is a power bi report with bar and pie charts colored with the colors from your imported theme file.

enter image description here

Upvotes: 5

Related Questions