series / group data members

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

An_economist
Posts: 3
Joined: Sat Apr 13, 2019 5:38 pm

series / group data members

Postby An_economist » Thu Apr 09, 2020 8:10 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: series / group data members

Postby EViews Gareth » Thu Apr 09, 2020 9:16 pm

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}

An_economist
Posts: 3
Joined: Sat Apr 13, 2019 5:38 pm

Re: series / group data members

Postby An_economist » Fri Apr 10, 2020 12:17 am

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?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: series / group data members

Postby EViews Gareth » Fri Apr 10, 2020 8:03 am

Depends on whether you want to keep the graph object around or not


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests