Page 1 of 1

a question about shading program.

Posted: Thu Apr 07, 2011 7:55 am
by Liu
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

Re: a question about shading program.

Posted: Thu Apr 07, 2011 8:06 am
by EViews Gareth
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?

Re: a question about shading program.

Posted: Thu Apr 07, 2011 9:17 am
by EViews Gareth
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)?

Re: a question about shading program.

Posted: Thu Apr 07, 2011 10:04 am
by Liu
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.

Re: a question about shading program.

Posted: Thu Apr 07, 2011 10:06 am
by EViews Gareth
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?