Page 1 of 1

Mixed graph by code

Posted: Wed May 06, 2015 6:37 am
by johansamuelsson
Hi

Suppose I have four series, a1, a2, a3 and a4. How do I by code create a mixed graph-object with two lines and two bars. I tried

Code: Select all

Graph dia1.mixed line(a1, a2) bar(a3, a4)
but that doesn't work?

Regards Johan

Re: Mixed graph by code

Posted: Wed May 06, 2015 7:51 am
by EViews Jason
You will have to first create a group with your series in it and then use the freeze command

Code: Select all

freeze(mynewgraph) mygroup.mixed line(a1,a2) bar(a3,a4)

Re: Mixed graph by code

Posted: Wed May 06, 2015 10:11 pm
by johansamuelsson
Thanks, next question. I tried put legend on, in the example below I thought that the individual number for the lines and bars should be 1,2,3,4 and 5. But it turns out that in this case the individual number are 1,2,8,9,5. I tried different variants and I'm not sure how it works, is there any "rule" how to know the first number for the lines, or is it a bug?

Regards Johan

Code: Select all

WfCreate u 20 For !i = 1 To 5 Series a{!i} = Nrnd Next Group g a* Freeze(dia) g.mixed bar(1,2,5) Line(3,4) For !i = 1 To 9 dia.name(!i) test{!i} Next Show dia

Re: Mixed graph by code

Posted: Thu May 07, 2015 10:20 am
by EViews Jason
That is a bug that will we fix

Re: Mixed graph by code

Posted: Tue Jun 02, 2015 6:17 am
by jbonanca
Hi,

I just wanted to ask a follow-up on the first part of this thread. If I have to freeze a group view to get the mixed graph (area band plus lines), I can't set the resulting chart to be auto-updating because it's not linked to data anymore.

In EViews 8, this wasn't a problem because I could write:

graph graph1.band(l) seriesa seriesb seriesc seriesd ..
graph1.setupdate(auto)
show graph1

and have a nice auto-updating graph staring at me after a program finished. Is there a way in Eviews9 to reproduce that behavior from a program? Am I missing something obvious? Thank you!

Re: Mixed graph by code

Posted: Tue Jun 02, 2015 8:42 am
by EViews Gareth
Nothing has changed - you can still set it to be an autoupdating graph.

Re: Mixed graph by code

Posted: Tue Jun 02, 2015 11:41 am
by jbonanca
I can't get it to work if I want to produce a mixed graph with an area band. If I run this code in EViews 8, I get an auto-updating graph, with the first two series forming the area band:

graph grz.band(l) series1 series2 series3 series4 series5
grz.setupdate(auto)

If I run the same code in EViews 9, it doesn't produce a band graph -- I just get a line graph. So looking at the earlier conversation in this thread, I use the following to produce a mixed graph with a band and lines:

group graphgroup series1 series2 series3 series4 series5
freeze(grz) graphgroup.mixed band(series1 series2) line(series3 series4 series5)
grz.setupdate(auto)

which produces the error that the "graph is not linked to data" and i cannot set autoupdate for the graph. If I get rid of the line setting autoupdate, I do get the graph type I want, but it is unlinked to data.

is there some other way? thank you!

Re: Mixed graph by code

Posted: Tue Jun 02, 2015 12:17 pm
by EViews Jason
We will get it fixed in the next patch

Re: Mixed graph by code

Posted: Wed Sep 23, 2015 8:38 am
by bsg9
Hi,

I have tried to replicate what you described earlier in this post, meaning :

Code: Select all

group gr0 a b c freeze(gr1) gr0.mixed line(a, b) bar(c)
but i keep getting the error :
MIXED is not a valid view for GR0 in "..."
Could you tell me what I have done wrong ?

Thank you very much !

Re: Mixed graph by code

Posted: Wed Sep 23, 2015 8:40 am
by EViews Gareth
Are you using EV9?

Re: Mixed graph by code

Posted: Thu Sep 24, 2015 12:48 am
by bsg9
No, Eviews 8. Is that the problem ?

Re: Mixed graph by code

Posted: Thu Sep 24, 2015 6:58 am
by EViews Gareth
Yes

Re: Mixed graph by code

Posted: Thu Sep 24, 2015 7:23 am
by bsg9
So I cannot make such graph with Eviews 8 ? Or is there any other code ?