graph mixed option

For questions regarding programming in the EViews programming language.

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

Elderfield.A
Posts: 78
Joined: Thu Jul 11, 2019 10:47 pm

graph mixed option

Postby Elderfield.A » Thu Sep 30, 2021 5:25 pm

Hi,

I am creating a stacked bar chart, with a line added. I do this using the mixed option. However, I want to create an add-in that takes a group object and then creates a mixed graph, using the last element in the group as the line. Add-in aside, is there a way to do this?

Essentially, I want to have this part automatically filled in for me based on the number of group elements

Code: Select all

group dumdat 1 2 3 4 5 6 7 8

freeze(test) dumdat.mixed stackedbar(1,2,3,4,5,6,7) line(8)




Where stackedbar(1,2,3,4,5,6,7) would automatically be 1 to (n-1) elements and line(8) is the nth element in group.

Any pointers?

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

Re: graph mixed option

Postby EViews Gareth » Thu Sep 30, 2021 6:43 pm

Something like:

Code: Select all

!n = dumdat.@count
%stk = ""
for !i=1 to !n-1
    %stk = %stk + "," + @str(!i)
next
%lne = @str(!n)
freeze(test) dumdat.mixed stackedbar({%stk}) line({%lne})
Follow us on Twitter @IHSEViews

Elderfield.A
Posts: 78
Joined: Thu Jul 11, 2019 10:47 pm

Re: graph mixed option

Postby Elderfield.A » Thu Sep 30, 2021 7:24 pm

Thanks for the speedy reply! Exactly what I was after!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 30 guests