Solved

How do I get strings to be untouched

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

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now