Solved

drawing a time series diagram

Posted on 2013-12-16
7
168 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change text to radio button and calendar form 2 36
Use a select control to call a javascript function 5 29
Objects on Same Line 2 18
how can i select 4 9
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

867 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

26 Experts available now in Live!

Get 1:1 Help Now