Page 1 of 1

series / group data members

Posted: Thu Apr 09, 2020 8:10 pm
by An_economist
Hi,

Is there a way to see what transformation has been applied to a series or group object? For example, when you open a series object, you have the option to change the series from "default" to "% change", via the little drop down box. I'd like to know if this information is stored somewhere in the object and can it be accessed? I am writing an add-in so a view can be chosen to format charts to my organisations requirements and one thing I'd like to do is place "Per cent" as the axis title if the user has transformed the series via the drop down box.

In addition to this, is there a way to update the "_this" command? What I want my add-in to do is essentially as follows:

The user selects a series or group from the workfile and choose "format chart" from the Procs/Add-ins menu, then the following add-in run:

Code: Select all

' Create a line plot of the selected series / group using "_this" (1) _this.line 'freeze this as a graph - cant seem to get this to work (2) ' change all the formats in the graph based on the desired settings (3) _this.template userdefinedtemplate 'A template that gets created when program is run ' Update axis title with "Per cent" if user has transformed the data if "some condition is met" then _this.addtext(-0.3,0.25) "Per cent" endif
If i run something like the above, I get the error "template is not a valid view for _this.template" which suggests I need to do something at step 2 before going to step 3. But I am not sure how to proceed.



Thanks

Adam

Re: series / group data members

Posted: Thu Apr 09, 2020 9:16 pm
by EViews Gareth
G'day.

Unfortunately, you cannot retrieve the state of that dropdown. Neat idea though, we'll put it on a list.

For your second question, I'd do something like this:

Code: Select all

%name = @getnextname("Chart") freeze({%name}) _this.line {%name}.template userdefinedtemplate 'other code here _this.display {%name} 'd {%name}

Re: series / group data members

Posted: Fri Apr 10, 2020 12:17 am
by An_economist
Thanks for the speedy reply Gareth, one quick one this last bit on you code which is commented out

Code: Select all

'd {%name}
Should I ignore that?

Re: series / group data members

Posted: Fri Apr 10, 2020 8:03 am
by EViews Gareth
Depends on whether you want to keep the graph object around or not