Page 1 of 1

Using a string list to name graph objects

Posted: Sun Aug 11, 2019 10:48 pm
by Elderfield.A
Hi,

I am using a string list to name the variables in a graph, I want be call them different names to their variable names and these names will have spaces in them:

Code: Select all

for !h =1 to chart1.@count ' this is a group of variables %4 = @wordq(%labels, !h) ' this is my string list - it looks like this %labels = """name one"" ""name two""" graph_one.name({!h}) %4 ' this is changing the name in the graph to the one in the list next
But when the graph is generated, the name object name has quotations marks around it - "name one".

Would be great to remove these quotation marks.

Thanks

Adam

Re: Using a string list to name graph objects

Posted: Sun Aug 11, 2019 11:57 pm
by EViews Gareth
{%4}

Re: Using a string list to name graph objects

Posted: Mon Aug 12, 2019 3:53 pm
by Elderfield.A
Thanks for the response Gareth, this was the first thing that I tried and was still not able to achieve the desired outcome. Any other suggestions? A couple of further points may be useful:

1) when I type in the name I don't get the issue:

Code: Select all

graph_one.name({!h}) name one
But this is not an option (to manually name each series) as this bit of code forms part of a subrountine that I can call quickly and easily make charts that formatted to my liking, and data labeled how I like.

2) when giving a chart a heading using the same approach using the graph.addtext command, I don't have the issue.

Grateful for your assistance.

Re: Using a string list to name graph objects

Posted: Wed Aug 14, 2019 7:44 am
by EViews Gareth

Code: Select all

%4 = @stripquotes(%4) graph_one.name(!h) {%4}

Re: Using a string list to name graph objects

Posted: Wed Aug 14, 2019 4:00 pm
by Elderfield.A
Thanks Gareth - that did the trick.