Forum Discussion

jlizzul's avatar
jlizzul
New Member
2 years ago

json cfg for ribbon chart

Hi everybody,

 

i'm trying to setup a json file for my graphic charter.

It seems that configuration for y axis doesn't work on ribben chart.
Here is my code :

 

 

 

 

"categoryAxis": [
          {
            "position": "Left",
            "show": true,
            "bold": false,
            "italic": false,
            "underline": false,
            "axisType": "Scalar",
            "axisScale": "linear",
            "invertAxis": false,
            "labelColor": {
              "solid": {
                "color": "#605E5C"
              }
            },
            "fontSize": 10,
            "fontFamily": "Segoe UI",
            "bold": false,
            "italic": false,
            "underline": false,
            "labelDisplayUnits": 0,
            "labelPrecision": 0,
            "preferredCategoryWidth": 20,
            "maxMarginFactor": 25,
            "concatenateLabels": true,
            "showAxisTitle": false,
            "titleColor": {
              "solid": {
                "color": "#252423"
              }
            },
            "titleFontSize": 10,
            "titleFontFamily": "Segoe UI",
            "titleBold": false,
            "titleItalic": false,
            "titleUnderline": false,
            "gridlineShow": true,
            "gridlineColor": {
              "solid": {
                "color": "#9CA7AE"
              }
            },
            "gridlineThickness": 1,
            "gridlineStyle": "dotted"
          }

 

 

 

 

Applying this json, my y axis title is in font family "Segoe UI Bold" and size is 12

i tried to add this section, but didn't work :

 

 

 

 

"yAxis": {
    "title": {
        "fontSize": {
            "expr": "10"
        },
        "fontColor": "#252423",
        "fontFamily": "Segoe UI",
        "fontWeight": {
            "expr": "normal"
        },
        "fontStyle": {
            "expr": "normal"
        },
        "textDecoration": {
            "expr": "none"
        }
    }
}

 

 

 

 

Does anyone have an idea about the resolution ?

 

Regards,

Julien

1 Reply

  • dm-p's avatar
    dm-p
    Super User

    Hi jlizzul.,

     

    MS publishes the JSON schema for themes in their GitHub repository. You can use this to refer to all properties if you're looking for them. For the y-axis on the ribbon chart, the key you need is "valueAxis". You can use this rule for any of the core cartesian charts (including scatter plot).

     

    If you want a less technical way, the theme generator by PowerBI.tips lets you configure properties using a set of graphical controls and export the JSON file, which is also an easier way to learn the schema. There is also a fairly cheap subscription option that lets you save your themes to an account and preview them using sample charts hosted in Power BI Embedded.

     

    Regards,

     

    Daniel