Solved

How do I get strings to be untouched

Posted on 2013-12-10
1
142 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

776 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