Forum Discussion

michal089's avatar
michal089
Frequent Visitor
7 years ago

How to change fontSize capability limits.

Hi,

 

I have following problem: i can't define limits of the fontSize  (apparently the upper one is 40 and the lower is 8). Additionaly I have not got a slider beside the input number:

 

Capabilities

 

My capabilities.json :

 

 

 "objects": {
        "customProperties": {
            "displayName": "Custom Properties",
            "properties": {
                "title": {
                    "displayName": "Title",
                    "type": { "text": true }
                },
                "rotation": {
                    "displayName": "Rotation",
                    "type": { "numeric": true }
                },
                "textSize": {
                    "displayName": "Text Size",
                    "type": {
                        "formatting": {
                            "fontSize": true
                        }
                    }
                }
                
                }
            }
    }

 

 

My settings.ts:

 

 

import DataViewObjectsParser = powerbi.extensibility.utils.dataview.DataViewObjectsParser;

export class VisualSettings extends DataViewObjectsParser {
  public customProperties: customPropertiesData = new customPropertiesData();
}
export class customPropertiesData {
  public title: string = "Title";
  public rotation: number = 0;
  public textSize: number = 100;
}

 

Anyone knows a solution? I would be grateful.

 

Michal

9 Replies

  • v-viig's avatar
    v-viig
    Community Champion

    Please rename textSize inti something else. For example: "fontSizeValue".

     

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]

    • michal089's avatar
      michal089
      Frequent Visitor

      Ok, now I have sth like this:

      "fontSizeValue": {
          "displayName": "Text Size",
          "type": {
              "formatting": {
                  "fontSize": true
              }
          }
      },

      And the output is:

       

       

       

      -Secondly, is there any option to leave data fields empty and eventually remove dataRoles from capabilities.json ? I am working on a totally static visual that doesn't need any data besides that entered with objects (Format tab). And my Visual is not updating unless I feed it with some data.

       

      Thanks for the reply!

      Michal

      • v-viig's avatar
        v-viig
        Community Champion

        You should use numeric type instead of fontSize as well.

         

        As far as I know, Power BI does not allot to use Custom Visuals w/o filled data fields.

         

        Ignat Vilesov,

        Software Engineer

         

        Microsoft Power BI Custom Visuals

        [email protected]