lib/nyaplot/diagram.rb in nyaplot-0.1.5 vs lib/nyaplot/diagram.rb in nyaplot-0.1.6
- old
+ new
@@ -168,9 +168,13 @@
# @return [Array<Symbol>] column labels to display in tool-tip box
# @!attribute legend
# @return [Bool] decide if the diagram prepare legend
define_group_properties(:options, [:title, :x, :y, :fill_by, :shape_by, :size_by, :color, :shape, :size, :stroke_color, :stroke_width, :tooltip_contents, :legend])
+ def tooltips(labels)
+ tooltip_contents((labels.is_a?(Symbol) ? [labels] : labels))
+ end
+
def process_data(df, labels)
label_x = labels[0]
label_y = labels[1]
x(label_x)
y(label_y)