Skip to content
jslade edited this page Sep 14, 2010 · 2 revisions

The :label_rotation attribute can be set to a value between [0,90] (in degrees


g = Gruff::Line.new g.title = "Labels rotated 90 degrees" g.labels = { 0 => '5/6', 1 => '5/15', 2 => '5/24', 3 => '5/30', } g.data(:apples, [-1, 0, 4, -4]) g.data(:peaches, [10, 8, 6, 3]) g.hide_line_markers = false g.label_rotation = 90 g.x_axis_label = "The x-axis labels are rotated, see?"

Result:

It will adjust the spacing reserved for the labels to account for the height of the rotated text.

Clone this wiki locally