?
Solved

drawing a time series diagram

Posted on 2013-12-16
7
Medium Priority
?
175 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 2000 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
Industry Leaders: 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!

 

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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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 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)
Suggested Courses

743 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