Graph - which line on top

For questions regarding programming in the EViews programming language.

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

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

Graph - which line on top

Postby johansamuelsson » Thu Apr 23, 2015 9:38 am

Hi

When plotting a graph with, for example, three lines then the last line is placed on top of the others. Is it possible to control the layers on the lines? For example in the code below I would like to have the first line (in this case "Base") on top, i.e. the blue one, but Eviews places "Scen2" on top. I could of course swap and draw "Base" as the last line but then the order of the legend would be "wrong".

Code: Select all

WfCreate a 2000 2015
Series Base
Series Scen1
Series Scen2
Base.fill 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
Scen1.fill 1,2,3,4,5,6,7,8,9,10,12,14,15,16,17,17
Scen2.fill 1,2,3,4,5,6,7,8,9,10,10,11,11,12,13,14
Graph g.line base scen1 scen2
g.setelem(1) linecolor(Blue)
g.setelem(2) linecolor(Red)
g.setelem(3) linecolor(Green)

Regards Johan

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

Re: Graph - which line on top

Postby EViews Gareth » Thu Apr 23, 2015 9:49 am

Not currently. The order of the series in the group is what dictates the draw order.
Follow us on Twitter @IHSEViews

MOG
Posts: 21
Joined: Sun Aug 25, 2013 6:42 am

Re: Graph - which line on top

Postby MOG » Wed Dec 07, 2016 10:04 am

I believe this would do the trick:

Code: Select all

WfCreate a 2000 2015
Series Base
Series Scen1
Series Scen2
Base.fill 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
Scen1.fill 1,2,3,4,5,6,7,8,9,10,12,14,15,16,17,17
Scen2.fill 1,2,3,4,5,6,7,8,9,10,10,11,11,12,13,14
Graph g.line base scen1 scen2 scen1 base
g.setelem(1) linecolor(Blue)
g.setelem(2) linecolor(Red)
g.setelem(3) linecolor(Green)
g.setelem(4) linecolor(Red)
g.setelem(5) linecolor(Blue)
g.name(4)
g.name(5)

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

Re: Graph - which line on top

Postby johansamuelsson » Thu Dec 08, 2016 12:32 am

Nice! Thanks MOG


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 12 guests