Gruff: In line graph I need lables at every dots

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’)

Venkat E. 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
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs