# Gruff: In line graph I need lables at every dots

**URL:** <https://www.ruby-forum.com/t/gruff-in-line-graph-i-need-lables-at-every-dots/193173>\
**Category:** Rails\
**Created:** [August 12, 2010, 1:27pm UTC](https://www.ruby-forum.com/t/gruff-in-line-graph-i-need-lables-at-every-dots/193173 "2010-08-12T13:27:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkat\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4af34b/32.png) [@venkat\_ruby](https://www.ruby-forum.com/u/venkat_ruby)\
**Post date:** [August 12, 2010, 1:27pm UTC](https://www.ruby-forum.com/t/gruff-in-line-graph-i-need-lables-at-every-dots/193173/1 "2010-08-12T13:27:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![venkat\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4af34b/32.png) [@venkat\_ruby](https://www.ruby-forum.com/u/venkat_ruby)\
**Post date:** [August 12, 2010, 6:32pm UTC](https://www.ruby-forum.com/t/gruff-in-line-graph-i-need-lables-at-every-dots/193173/2 "2010-08-12T18:32:10Z")

</div>

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](http://www.marnen.org)  
removed\_email\_address@domain.invalid
