3 Replies Latest reply on Jun 14, 2017 1:13 PM by Roger Palmen

    PI Vision custom symbol shown as zero size

    Roger Palmen

      Somehow i can't find where this is controlled in the settings or configuration.

       

      I have a custom Coresight symbol (not yet PI Vision). When i drag that onto a display, the size of the symbol is zero pixels. As a consequence, the sizing handles are placed on top of each other. I can drag them outward one by one, but something seems to be missing in my config..

       

      Part of my .js:

       

       var definition = {
              typeName: 'MySymbol',
              displayName: 'DisplayName',
              datasourceBehavior: CS.Extensibility.Enums.DatasourceBehaviors.Single,
              Height: 100,
              Width: 200,
              visObjectType: symbolVis,
              iconUrl: '/Scripts/app/editor/symbols/ext/Icons/MySymbol.png',
              getDefaultConfig: function () {
                  return {
                      DisplayText: "MySymbol",
                      TextSize: "20px",
                      PanelHeight: "100px",
                      PanelWidth: "200px"
                  };
              },
              configTitle: 'Configure Symbol...'
          };
      

       

      And my -template.html:

      <div id="outerbox" ng-style="{'position':'relative'
           , 'width': config.PanelWidth
           , 'height': config.PanelHeight
           , 'border':'2px rgba(0,0,0,0.8)'
           , 'font-size': config.TextSize
           , 'text-align': 'left'
           , 'text-indent': '10px'
           , 'color': 'rgba(0,0,0,0.8)'
           , 'background-color': 'rgba(255,255,255,1.0)'}">
          <p>{{config.DisplayText}}</p> <hr />
      </div>
      
        • Re: PI Vision custom symbol shown as zero size
          nicka

          Your Width and Height should be in the default config, not the definition:

           

          var definition = { 

              typeName: 'MySymbol', 

              displayName: 'DisplayName', 

              datasourceBehavior: CS.Extensibility.Enums.DatasourceBehaviors.Single,

              visObjectType: symbolVis, 

              iconUrl: '/Scripts/app/editor/symbols/ext/Icons/MySymbol.png', 

              getDefaultConfig: function () { 

                  return {  

                      Height: 100, 

                      Width: 200, 

                      DisplayText: "MySymbol", 

                      TextSize: "20px", 

                      PanelHeight: "100px", 

                      PanelWidth: "200px" 

                  }; 

              }, 

              configTitle: 'Configure Symbol...' 

          };

          2 of 2 people found this helpful
          • Re: PI Vision custom symbol shown as zero size
            pmartin

            Hi Roger,

             

            Try moving the Height/Width inside the getDefaultConfig function.

            1 of 1 people found this helpful