a question about shading program.

For questions regarding programming in the EViews programming language.

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

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

a question about shading program.

Postby Liu » Thu Apr 07, 2011 7:55 am

Hi all.

I wrote a subroutine that shade a graph according to a series. The program is as below.

My problem is, after shading, the graph was given a verticle black line(either at the very beginning or the end of a graph)when the graph begins or ends with a shade area.

Could anyone tell me where this line is from and how to solve it? Thank you very much in advance.


subroutine shade(series x, graph %graphname)
smpl @all
scalar obs=@obs(x)
scalar nas=@nas(x)
scalar total=obs + nas

for !i=2 to total
if x(!i)>x(!i-1) then
%shadedate=@otods(!i-1)
%shadedate2=@otods(!i)
graphname.draw(shade, bottom, rgb(215, 216, 203)) %shadedate %shadedate2
endif
next
endsub
Attachments
graph.pdf
(8.98 KiB) Downloaded 280 times

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

Re: a question about shading program.

Postby EViews Gareth » Thu Apr 07, 2011 8:06 am

Maybe it is the time of the morning, but I can't quite see what form X should take. How do you specify X to create the shading?

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

Re: a question about shading program.

Postby EViews Gareth » Thu Apr 07, 2011 9:17 am

Actually, I may have figured it out, but I cannot replicate the issue you're seeing. What's the build date of your copy of EViews (available from Help->About EViews)?

Liu
Posts: 90
Joined: Tue Jun 08, 2010 6:22 am

Re: a question about shading program.

Postby Liu » Thu Apr 07, 2011 10:04 am

It says feb 2 2011 .
so I guess the version should be fine.
the version is 7.1.

Also to answer your question about x, it could be any series of any frequency.

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

Re: a question about shading program.

Postby EViews Gareth » Thu Apr 07, 2011 10:06 am

You might want to update your copy to the latest version.

If you still have the problem, could you upload the workfile and the program that calls the subroutine?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests