Solved

drawing a time series diagram

Posted on 2013-12-16
7
172 Views
Last Modified: 2014-01-08
I want to draw a time series diagram On the X-axis ,I want to mark out months like this:

2012-1     (January 2012)
2012-2     ....
2012-3
2012-4
2012-5
2012-6
...

Could someone give a sample expressions that achieves this?
0
Comment
Question by:mdoland
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39721335
Hi,
could you please explain what you mean with
a sample expressions that achieves this
?

What charting library are you using?
Do you have already some sort of script and HTML code?

THanks.
Rainer
0
 

Author Comment

by:mdoland
ID: 39721364
I use Flot. I dont have any html.
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39721603
Hi,

I have provided a simple sample here:
http://jsfiddle.net/EE_RainerJ/vFTYA/

To display the month names, you have to configure/set the x-axis options like
        xaxis: { 
                 mode: "time",
                 timeformat: "%y-%m",
                 tickSize: [1, "month"],
                 min: (new Date(2011, 12, 1)).getTime(), 
                 max: (new Date(2013, 2, 1)).getTime()
        }

Open in new window


HTH
Rainer
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:mdoland
ID: 39723834
Excellent!

One more related question ... with %y I am supposed to get the full year ... 4 digits. On the jsfiddle I do get all 4 digits, however not in my application. What could cause that? I only get the 2 last digits. I use the same browser so it can't be that.
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39723941
Hm,
could depend on the data - perhaps its not correctly interpreted as dates / datetimes.

Could you provide your data array?

HTH
Rainer
0
 

Author Comment

by:mdoland
ID: 39725994
Here it is:
	    serie1 = [[new Date(2002,1,1), 0.39], [new Date(2003,1,1), 0.27], [new Date(2004,1,1), 0.60],[new Date(2005,1,1), 0.75],[new Date(2006,1,1), 0.61],
	              [new Date(2007,1,1), 0.22],[new Date(2008,1,1), 0.1],[new Date(2009,1,1), 0.4],[new Date(2010,1,1), 0.15],[new Date(2011,1,1), 0.22],
	              [new Date(2012,1,1), 0.36],[new Date(2013,1,1), 0.10]];
	    serie2 = [[new Date(2002,1,1), 0.29], [new Date(2003,1,1), 0.22], [new Date(2004,1,1), 0.20],[new Date(2005,1,1), 0.75],[new Date(2006,1,1), 0.22],
	              [new Date(2007,1,1), 0.22],[new Date(2008,1,1), 0.5],[new Date(2009,1,1), 0.4],[new Date(2010,1,1), 0.22],[new Date(2011,1,1), 0.11],
	              [new Date(2012,1,1), 0.34],[new Date(2013,1,1), 0.22]];

Open in new window

0
 

Author Comment

by:mdoland
ID: 39725999
It seems to show up correctly when I put it in you fiddle code.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ajax to record click 3 16
html border input line 7 13
Wordpress Only run code if on a certain page 11 22
Autocomplete with Jquery Question 2 19
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

839 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