I am implementing Line graph. I want to have labels just above every
dots inside graph. Please help me to implement.
require ''rubygems''
require ''gruff''
graph = Gruff::Line.new("594x384")
graph.theme = {
:marker_color => ''#aaa'',
:background_colors => [''#ffffff'',
''#fff'']
}
graph.y_axis_increment = 100
graph.replace_colors([''#999999'',''#bbd65b'',''green''])
graph.data("first",
[100,190,110,230,460,400,550,450,620,300,470,140,1000])
graph.data("second", [400,500,420,580,580,680,830,500,900,600])
graph.legend_font_size = 15
graph.marker_font_size = 15
graph.title_font_size = 15
graph.line_width = 2
graph.dot_radius = 3
graph.labels = {
0 => ''12AM'',
2 => ''4AM'',
4 => ''8AM'',
6 => ''12PM'',
8 => ''4PM'',
10 => ''8PM'',
}
graph.minimum_value = 0
graph.y_axis_label= "Number of Impressions"
graph.x_axis_label= "Time"
graph.write(''my_graph.png'')
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Aug-12 16:32 UTC
Re: Gruff: In line graph I need lables at every dots
Venkat Eee wrote:> I am implementing Line graph. I want to have labels just above every > dots inside graph. Please help me to implement.What have you tried, and what isn''t working?> > > require ''rubygems'' > require ''gruff'' > graph = Gruff::Line.new("594x384")[...] This question has absolutely nothing to do with Rails, and so it''s off topic here. Please ask in the Gruff forum if there is one, or failing that in the Ruby forum. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.