lib/seer/line_chart.rb in seer-0.6.1 vs lib/seer/line_chart.rb in seer-0.7.0

- old
+ new

@@ -66,11 +66,13 @@ end def data_columns #:nodoc: _data_columns = " data.addRows(#{data_rows.size});\r" _data_columns << " data.addColumn('string', 'Date');\r" - data.each do |datum| - _data_columns << " data.addColumn('number', '#{datum.send(series_label)}');\r" + if data.first.respond_to?(series_label) + data.each{ |datum| _data_columns << " data.addColumn('number', '#{datum.send(series_label)}');\r" } + else + data.each{ |datum| _data_columns << " data.addColumn('number', '#{series_label}');\r" } end _data_columns end def data_table #:nodoc: