Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

JSON dataColors on barChart, is it possible?

Good afternoon,

 

I've been for two weeks searching a way to apply different dataColors on JSON on some visuals, as can be on barChart or other visuals where you can apply dataColors at the time of its creation.

 

Is it possible?

 

Thank you in advance

 

5 Replies

  • my understanding is that you cannot swap individual colors. You have to swap the entire theme.

    It's a one-way street. I don't think you can write back from Power BI Desktop into the theme file. Nice idea though!

  • Conditional Formatting accepts colors as field values, either clear text ("green") or in RGB ("#00FF00").  Not sure what you mean by "dataColors on JSON"?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey Idendlin,

       

      As you might know, you can define styles on a JSON and import it on Power BI to affect on visualitzacions.

       

      In some visuals, as can be barChart, lineChart, etc. you have the possibility of change the colors but semestre that on JSON file, its not possible to define it easily. Do you have any idea on how to do it?

       

      Thank you in advance!

    • Anonymous's avatar
      Anonymous
      Not applicable

      More or less,

       

      I've created a JSON, I'll just attach you one chart of the visuals to explain what I'm looking for:

      "pieChart":

              {"*":

                  {"legend":

                      [

                          { "show": false}

                      ],

                      "labels":

                      [{

                              "show": true,

                              "labelStyle": "Category",

                              "color":

                              {"solid":

                                  {"color": "#616161"}

                              },

                              "labelDisplayUnits": "Auto",

                              "fontSize": 8.1,

                              "fontFamily": "Arial",

                              "position": "outside"

                          }],

                      "title":

                      [{

                              "show": true,

                              "wordWrap": true,

                              "fontColor":

                              {"solid":

                                  {"color": "#000000"}

                              },

                              "background":

                              {"solid":

                                  {"color": "#FFFFFF"}

                              },

                              "alignment": "Left",

                              "fontSize": 10.5,

                              "fontFamily": "Arial Black"

                          }

                      ]

                  }

              }

       

      What I need is to include here some colors that are differents from the ones define previously. That's something you can do manually on Desktop, but I would like to include it on the JSON file.