Bug Graph Eviews 13

For notifying us of what you believe are bugs or errors in EViews.
Please ensure your copy of EViews is up-to-date before posting.

Moderators: EViews Gareth, EViews Moderator

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Bug Graph Eviews 13

Postby johansamuelsson » Sun Oct 16, 2022 10:42 pm

Hello

Our company uses Eviews graphs both for internal use and external publication and powerpointpresentations. We use emf-images because they provide a sharper image.

In Eviews 12 the graph looks fine.

In Eviews 13, however, there has been something wrong with the positioning of the various elements. The text in the header and subheader appears too dense, the chart area extends over the left x-axis, and the labels end up too far to the left and overlap the label lines.

See the attached pdf-file and code if you want to test it yourself.

Best regards Johan

Graph.pdf
(116.04 KiB) Downloaded 88 times


Code: Select all

WfCreate(page=Q) Q 2019q4 2023q4
Call Data
%p = @LinePath
!ver = @VerNum

PageSelect Q
Group group1 n*
Freeze(G1) group1.mixed  line(1) line(2) line(3) line(4)

G1.name(1) Business sector
G1.name(2) Manufacturing industry
G1.name(3) Service sector
G1.name(4) Construction industry

G1.addtext(0, -0.65,Just(L),textcolor(@rgb(40, 40, 40)),Font(Verdana,18,B))Productivity
G1.addtext(0, -0.35,Just(L),textcolor(@rgb(40, 40, 40)),Font(Verdana,16))Index 2019Q4 = 100

G1.axis(b) -minor
G1.axis(b) angle(0)
G1.axis(b) font(verdana,16)


G1.axis(l) range(85,115)
G1.axis(l) mirror format(commadec, -ksep, leadzero)
G1.axis(l) font(Verdana, 16)
G1.axis(r) mirror format(commadec, -ksep, leadzero)
G1.axis(r) font(Verdana, 16)

G1.axis dual

G1.datelabel format(YYYY)

G1.options size(7.36,4.6)
G1.options linepat
G1.options -barspace
G1.options backfade(none) fillfade(none) backcolor(white) framecolor(white) -background
G1.options backfade(none) fillfade(none) backcolor(white) framecolor(@rgb(128,128,128)) -background

G1.setfont legend(verdana, 16)

G1.legend display
G1.legend position(bl) font(verdana, 16) -inbox columns(1)

G1.options gridnone
G1.options gridl gridpat(dash6) gridcolor(gray) gridwidth(0.5) -gridontop

G1.setelem(1) linewidth(2)   linepattern(1)  linecolor(@Rgb(0, 112, 158)) fillcolor(@Rgb(0, 112, 158)) fillhatch(1)
G1.setelem(2) linewidth(2)   linepattern(1)  linecolor(@Rgb(247, 73, 2)) fillcolor(@Rgb(247, 73, 2)) fillhatch(1)
G1.setelem(3) linewidth(2)   linepattern(1)  linecolor(@Rgb(112, 147, 2)) fillcolor(@Rgb(112, 147, 2)) fillhatch(1)
G1.setelem(4) linewidth(2)   linepattern(1)  linecolor(@Rgb(132, 33, 107))fillcolor(@Rgb(132, 33, 107)) fillhatch(1)

G1.save(t=Emf, u=cm, w=22.08, h=13.8, trans) {%p}graph_{!ver}
G1.save(t=Jpeg, u=cm, w=22.08, h=13.8, -trans, d=600) {%p}graph_{!ver}

'_____________________________________________________________________________________


Subroutine data

   Series Nprtjvebpfsi
   Series Nprnbpfsi
   Series Nprindubpfsi
   Series Nprbyggbpfsi

   Nprtjvebpfsi.Fill 100.00, 100.65, 100.77, 105.33, 103.56, 102.47, 104.42, 105.46, 106.31, 107.09, 107.10, 106.39, 105.27, 104.62, 104.48, 104.35, 104.40
   Nprnbpfsi.Fill 100.00, 101.48, 99.43, 106.25, 103.78, 103.12, 105.03, 106.06, 106.43, 106.72, 106.60, 106.25, 105.39, 104.92, 104.84, 104.80, 104.92
   Nprindubpfsi.Fill 100.00, 104.17, 88.92, 110.85, 106.11, 104.02, 105.21, 108.05, 107.23, 106.75, 104.32, 105.05, 104.41, 104.62, 104.73, 104.94, 105.25
   Nprbyggbpfsi.Fill 100.00, 101.90, 107.83, 108.29, 101.10, 101.51, 103.39, 104.53, 105.11, 104.57, 104.47, 104.79, 105.11, 104.58, 104.79, 105.00, 105.32

EndSub

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Bug Graph Eviews 13

Postby EViews Jason » Mon Oct 17, 2022 9:16 am

In EViews 13, we've added the ability to set line and bar opacity. By default this is on. This has a very noticeable effect on the emf graphs. With opacity on, lines become dashed lines. To turn off, opacity in your program use:

Code: Select all

g1.setelem(1) lineopacity(OFF,0.75)
g1.setelem(2) lineopacity(OFF,0.75)
g1.setelem(3) lineopacity(OFF,0.75)
g1.setelem(4) lineopacity(OFF,0.75)


With that being said, even with it opacity on, we could not generate the EViews 13 image in your PDF where there appears to be an extra frame/box that overlaps the y-axis label and the legend text overlaps with the legend lines.

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: Bug Graph Eviews 13

Postby johansamuelsson » Mon Oct 17, 2022 9:41 pm

Ok then the graph in Evews 13 will be ok, i.e. if I put

Code: Select all

g1.setelem(1) lineopacity(OFF,0.75)

But I don't really understand the command, why are there two arguments, according to "Command Reference help" it should only be one argument and a value between 0 and 1, i.e.

Code: Select all

g1.setelem(1) lineopacity(1)

Can't find anything written about "OFF" as an argument?

But whether the lines are transparent or not shouldn't affect the placement, so feel free to continue investigating this.

Another thing, using the same code as before also creates a jpg-file. There will be a relatively large white area around the graph. Is it possible to shrink that surface so that the image only shows the diagram itself. See

G1.jpg
G1.jpg (657.08 KiB) Viewed 3151 times


Regards Johan

yguill1
Posts: 11
Joined: Tue Jan 31, 2012 1:53 am

Re: Bug Graph Eviews 13

Postby yguill1 » Tue Oct 18, 2022 7:51 am

Unless one sets lineopacity(OFF), exporting a line chart to EPS (with the Proc - Save graph to disk command) produces an empty chart - no lines are visible. This does not seem to be intended behavior. Using Eviews 13 Oct 11 build.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Bug Graph Eviews 13

Postby EViews Jason » Tue Oct 18, 2022 8:35 am

The docs are wrong and we will get it corrected. The docs should read

Lineopacity(arg) where arg is the mode and/or the opacity value. Three acceptable values for mode are ON, OFF, and AUTO. Opacity value can be an value from 0 to 1.
Setting the level to 0.0 or setting the mode to OFF will make the object completely transparent (0% opacity) while a value of 1.0 (assuming the mode is ON) will make the object completely opaque (100% opacity).

Examples:

Code: Select all

mygraph.setelem(1) lineopacity(off) 'turns off line opacity
mygraph.setelem(1) lineopacity(on) 'enables line opacity whereby the opacity value does not change
mygraph.setelem(1) lineopacity(on, 0.5) 'enables line opacity and set the opacity value to 0.5
mygraph.setelem(1) lineopacity(0.5) 'set the opacity value to 0.5. But depending on the current mode may not have any visual effect


In regards to the jpg whitespace, some of it can be removed by adjusting the size. EViews will not change the aspect ratio graphs. It will look for the limiting dimension whether that be width or height and then size accordingly.

In your example you have:

Code: Select all

G1.save(t=Jpeg, u=cm, w=22.08, h=13.8, -trans, d=600) {%p}graph_{!ver}

and this creates a graph with a lot of whitespace on the sides. By just lowering the width:

Code: Select all

G1.save(t=Jpeg, u=cm, w=20.08, h=13.8, -trans, d=600) {%p}graph_{!ver}
you will get less whitespace.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Bug Graph Eviews 13

Postby EViews Jason » Tue Oct 18, 2022 8:59 am

The EPS issue will be fixed in the next patch


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 32 guests