Forum Discussion

rks's avatar
rks
Resolver II
1 year ago
Solved

JSON Theme: Format Series for IBCS

Hi,

 

using the newly released style presets (Power BI March 2025 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI) I wanted to create a style for IBCS charts.

 

I have a clustered column chart and want to create a series for "AC" and one for "PL". Currently I have created this part of the JSON file:

 

"clusteredColumnChart": {
            "*": {
                "title": [
                    {
                        "show": true
                    }
                ]
            },
            "Kontext Target": {
                "title": [
                    {
                        "show": true
                    }
                ],
                "legend": [
                    {
                        "show": false
                    }
                ],
                "categoryAxis": [
                    {
                        "show": true,
                        "showAxisTitle": false
                    }
                ],
                "valueAxis": [
                    {
                        "show": true,
                        "showAxisTitle": false
                    }
                ],
                "labels": [
                    {
                        "show": true
                    },
                    {
                        "$id": "PL",
                        "show": false
                    },
                    {
                        "$id": "AC",
                        "show": true
                    }
                ],
                "layout": [
                    {
                        "clusteredGapSize": 50,
                        "clusteredGapOverlaps": true,
                        "clusteredGapOverlapReverse": true
                    }
                ]
            }
        },

 For the PL series e.g. I want to disable labels, for the AC-series the labels should be visible. Also I want to have the AC-bars (dataPoint) filled with Color1 and the PL-bars to be filled with Color1, 80% transparency and also a border that matches the color with 60% transparency..

 

I do know the JSON terminology - it works on a global level - but somehow I can't figure out a way to just style one data-series. 

 

Best regards,
Konstantin

  • Hi  rks , 

     

    Attached the json which will work for clustered column charts.

     

    You are correct to expect the JSON structure to work for data labels. However, Power BI's March 2025 style preset support currently does not fully honor per-series overrides like "$id" inside the labels sections. This limitation is why your "$id": "5WP" and "$id": "AC" are being ignored.

     

    As you mentioned earlier, as a workaround, manually apply per-series settings using the formatting pane.

     

    I recommend submitting your ideas through Microsoft's official feedback channels, such as the Microsoft Fabric Ideas.  

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

     

    Thank you!!

3 Replies

  • v-sathmakuri's avatar
    v-sathmakuri
    Community Support

    Hi rks ,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Would you like a formatted JSON that returns the expected results, or are you looking to build a chart using the JSON you provided?

     

    Thank you!!

    • rks's avatar
      rks
      Resolver II

      Hi v-sathmakuri , not sure if I understand the question properly. 

       

      I do have a JSON theme and want to add the functionality to have Presets. That generally works and it is a super useful feature

      Unrelated to Presets.. What I struggle with is formating data series.

       

      Example 1: Labels

       

       

       

      I have two series, AC and 5WP. I want to use the the JSON Theme to always disable labels for 5WP and always show the labels for AC:

       

      The following JSON-excerpt does not produce the desired results:

       

      "labels": [
                          {
                              "show": true
                          },
                          {
                              "$id": "5WP",
                              "show": false
                          },
                          {
                              "$id": "AC",
                              "show": true
                          }
                      ],

       

       

      Example 2: Columns:

       

       

      I want to style the data colums:

      "dataPoint": [
                          {
                              "$id": "AC",
                              "fill": {
                                  "solid": {
                                      "color": "#000000"
                                  }
                              }
                          },
                          {
                              "$id": "5WP",
                              "fillTransparency": 90,
                              "borderColorMatchFill": true,
                              "borderTransparency": 60,
                              "fill": {
                                  "solid": {
                                      "color": "#000000"
                                  }
                              }
                          }
                      ]

       

      This also does not take into account the "$id" and colours are not changed by importing the theme file.

       

      Here's the whole excerpt for the clusteredcolumnchart:

      "clusteredColumnChart": {
                  "*": {
                      "title": [
                          {
                              "show": true
                          }
                      ],
                      "y1AxisReferenceLine": [
                          {
                              "$id": "Constant line 1",
                              "show": true,
                              "lineColor": {
                                  "solid": {
                                      "color": {
                                          "expr": {
                                              "ThemeDataColor": {
                                                  "ColorId": 3
                                              }
                                          }
                                      }
                                  }
                              },
                              "transparency": 0,
                              "style": "solid",
                              "position": "back"
                          }
                      ]
                  },
                  "Kontext Target": {
                      "title": [
                          {
                              "show": true
                          }
                      ],
                      "legend": [
                          {
                              "show": false
                          }
                      ],
                      "categoryAxis": [
                          {
                              "show": true,
                              "showAxisTitle": false
                          }
                      ],
                      "valueAxis": [
                          {
                              "show": true,
                              "showAxisTitle": false
                          }
                      ],
                      "labels": [
                          {
                              "show": true
                          },
                          {
                              "$id": "5WP",
                              "show": false
                          },
                          {
                              "$id": "AC",
                              "show": true
                          }
                      ],
                      "layout": [
                          {
                              "clusteredGapSize": 50,
                              "clusteredGapOverlaps": true,
                              "clusteredGapOverlapReverse": true
                          }
                      ],
                      "dataPoint": [
                          {
                              "$id": "AC",
                              "fill": {
                                  "solid": {
                                      "color": "#000000"
                                  }
                              }
                          },
                          {
                              "$id": "5WP",
                              "fillTransparency": 90,
                              "borderColorMatchFill": true,
                              "borderTransparency": 60,
                              "fill": {
                                  "solid": {
                                      "color": "#000000"
                                  }
                              }
                          }
                      ]
                  }
              },

       

      • v-sathmakuri's avatar
        v-sathmakuri
        Community Support

        Hi  rks , 

         

        Attached the json which will work for clustered column charts.

         

        You are correct to expect the JSON structure to work for data labels. However, Power BI's March 2025 style preset support currently does not fully honor per-series overrides like "$id" inside the labels sections. This limitation is why your "$id": "5WP" and "$id": "AC" are being ignored.

         

        As you mentioned earlier, as a workaround, manually apply per-series settings using the formatting pane.

         

        I recommend submitting your ideas through Microsoft's official feedback channels, such as the Microsoft Fabric Ideas.  

         

        If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

         

        Thank you!!