Tuesday, May 1, 2012

[Rails] Re: Flot won't Plot

Ok I got it....

Ruby code:

@o={};
@o= {'label' => "A", 'data' => @example.collect{|x|
[Time.utc(x.date).to_i, x.num]}}

Java code:

$(function () {

var obj = <%= @o.to_json %>;
var options = {
lines: { show: true },
points: { show: true },
xaxis: { mode: "time", timeformat: "%m/%d/%y", minTickSize: [1,
"day"]}
};

var data = obj;
$.plot(placeholder,[data],options);
});

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate