Solved

drawing a time series diagram

Posted on 2013-12-16
7
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

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

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

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
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)

726 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