Shading

For questions regarding programming in the EViews programming language.

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

amrsherif
Posts: 99
Joined: Mon Jul 23, 2018 4:34 pm

Shading

Postby amrsherif » Thu Oct 05, 2023 7:39 am

Hi,

I guess i have not used this shading code in a while, maybe since EViews 10 or 11, but i cannot seem to shade anymore in EViews 12 & 13.

I have a string with dates, named c1nber. And I am looping through the dates in the string to shade like so:

for %shadedate %shadedate2 {c1nber}
c1.draw(shade, bottom, rgb(237,236,231)) %shadedate %shadedate2
next

Example dates in c1nber are 1956M10 1956M11. however, I am getting a bad line/shade specification error.
Any idea as to why this works in older version of EViews but not the most recent ones, and what i can do to fix it?

Thank you!

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

Re: Shading

Postby EViews Gareth » Thu Oct 05, 2023 8:01 am

Seems to work ok for me in a test program:

Code: Select all

wfcreate m 1950 1960
string c1nber = "1956m10 1956m11"

series y=@nrnd
freeze(c1) y.line

for %shadedate %shadedate2 {c1nber}
c1.draw(shade, bottom, rgb(237,236,231)) %shadedate %shadedate2
next
Follow us on Twitter @IHSEViews

amrsherif
Posts: 99
Joined: Mon Jul 23, 2018 4:34 pm

Re: Shading

Postby amrsherif » Thu Oct 05, 2023 12:05 pm

Thanks, Gareth. I realized what the issue is. In case somebody else runs into this, my string included dates that were outside of the sampe of the graph. For exmaple, it included 1956, but my graph only started in 1975.

Not sure why this works in earlier versions of EViews but at least i got it to work on current versions.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 24 guests