9 Replies Latest reply: Aug 12, 2013 7:09 AM by Patrik Seger RSS

Label for Expression in Extension

Nicole Smith

Right now, in all of my extensions (and all of the extensions that I can find from other people), the labels for my expressions are just the expression itself.  Is there a way to have the user define a label for the expression?  I know I would need to put some type of input box in the .qvpp file, but I'm not quite sure how to go about doing this.  Any help would be greatly appreciated.  Thanks!

  • Label for Expression in Extension
    Erik Wetterberg

    The easiest way would be to use Text properties for labels.

     

    Erik

    • Re: Label for Expression in Extension
      Nicole Smith

      I'm sorry Erik, I'm not quite sure what you mean, and maybe I'm not explaining myself properly.

       

      Currently, what I am able to do in my script.js is to use this.Data.HeaderRows[0][x] to get the Dimension and Expression that the user chose to make the chart.  So if I have one dimension (Clothing) and one expression (sum(Sales)), this.Data.HeaderRows[0][0] returns Clothing and this.Data.HeaderRows[0][1] returns sum(Sales).  However, what I want to do is allow the user to give a name to sum(Sales) since they may want to name it "Total Sales" or something else.  So, what I really want to do is to put an input box on the properties page that works like this input box on a regular chart object, see below (however, I don't know what syntax I need in order to include this in the .qvpp file):

       

       

      ExpressionLabel.png

  • Re: Label for Expression in Extension
    backbutton

    Is there a way to have dynamic legends/labels for expression on the chart? 

     

    Suppose, per tutorial, we have quantity and revenue as a cyclic group in two expression.  When I change the expression, I would like to see Quantity as the label or legend in the chart, and ditto for Revenue, so I know whether I am looking at Quantity or Revenue.  But the chart only shows the chart title set in the general tab, for example, Quantity, and it does not vary dynamically, and this is not correct. 

     

    I have asked this question before and have not obtained an answer.  I have been playing with this and don't know how to get around this. 

     

     

    Seems like a flaw.

  • Re: Label for Expression in Extension
    backbutton

    Is there a way to have dynamic legends/labels for expression on the chart? 

     

    Suppose, per tutorial, we have quantity and revenue as a cyclic group in two expression.  When I change the expression, I would like to see Quantity as the label or legend in the chart, and ditto for Revenue, so I know whether I am looking at Quantity or Revenue.  But the chart only shows the chart title set in the general tab, for example, Quantity, and it does not vary dynamically, and this is not correct. 

     

    I have asked this question before and have not obtained an answer.  I have been playing with this and don't know how to get around this. 

     

     

    Seems like a flaw.