Solved

How do I get strings to be untouched

Posted on 2013-12-10
1
152 Views
Last Modified: 2014-01-08
I try to print this in a time series graph however it makes a number out of the 2013-1 => 2012 and the rest similarly. How do I avoid that?

[[2013-1, 0.39], [2013-2, 0.27], [2013-3, 0.60],[2013-4, 0.75],[2013-5, 0.6],[2013-6, 2],[2013-7, 5],[2013-8, 0.4],[2013-9, 15],[2013-10, 0.22],[2013-11, 0.36],[2013-12, 0.10]];
0
Comment
Question by:mdoland
1 Comment
 
LVL 22

Accepted Solution

by:
Kim Walker earned 500 total points
ID: 39708381
Strings are delimited by quote marks. If you want 2013-1 to be a string instead of 2013 minus 1 = 2012, you must enclose it in quote marks. Single or double, doesn't matter in this case.
[['2013-1', 0.39], ['2013-2', 0.27], ['2013-3', 0.60],['2013-4', 0.75],['2013-5', 0.6],['2013-6', 2],['2013-7', 5],['2013-8', 0.4],['2013-9', 15],['2013-10', 0.22],['2013-11', 0.36],['2013-12', 0.10]];

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question