Home
> Discussions & Support
> Topic
pie from textarea
Posted by jirkaz
pie from textarea October 16, 2008 02:30PM |
Registered: 15 years ago Posts: 5 |
Re: pie from textarea October 17, 2008 05:52AM |
Registered: 15 years ago Posts: 117 |
Re: pie from textarea October 17, 2008 09:57AM |
Registered: 15 years ago Posts: 5 |
I have in <textarea id=mypye>"dogs",50;"cats",30;"rats",30</textarea>
I translate value in Javascript to " ['dogs',50],['cats',30],['rats',20] " and used
pom="['IE7', 26], ['IE6', 24.6], ['Firefox', 44.2], ['Safari', 2.6], ['Opera', 2.1]"
but var myData = new Array(pom) gives "Data in wrong format."
var myData = new Array(['IE7', 26], ['IE6', 24.6], ['Firefox', 44.2], ['Safari', 2.6], ['Opera', 2.1]); works fine.
Is there a way, how to overcome this?
Ji
I translate value in Javascript to " ['dogs',50],['cats',30],['rats',20] " and used
pom="['IE7', 26], ['IE6', 24.6], ['Firefox', 44.2], ['Safari', 2.6], ['Opera', 2.1]"
but var myData = new Array(pom) gives "Data in wrong format."
var myData = new Array(['IE7', 26], ['IE6', 24.6], ['Firefox', 44.2], ['Safari', 2.6], ['Opera', 2.1]); works fine.
Is there a way, how to overcome this?
Ji
Re: pie from textarea October 17, 2008 10:19AM |
Registered: 15 years ago Posts: 117 |
Keeping the quotes arround ['dogs',50],['cats',30],['rats',20] will transform the data into a string.
You have a few options here, you can use the next code:
Sabin
pom = "['dogs',50],['cats',30],['rats',20]";pom will be a string, but you will need a list of arrays (the brackets here are equivalent to new Array() ).
You have a few options here, you can use the next code:
pom = new Array(['dogs',50],['cats',30],['rats',20]); var myData = pom;or the simplest would be to use:
var myData = new Array(['dogs',50],['cats',30],['rats',20]);
Sabin
Re: pie from textarea October 17, 2008 03:50PM |
Registered: 15 years ago Posts: 5 |
Re: pie from textarea October 17, 2008 04:01PM |
Registered: 15 years ago Posts: 5 |
Re: pie from textarea October 20, 2008 05:02AM |
Registered: 15 years ago Posts: 117 |
Sorry, you do not have permission to post/reply in this forum.