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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to