mattetti/googlecharts

Data scaling for line_xy

Opened this issue · 0 comments

I'm trying to generate this

So, that's setting the scaling both lines independently, but identically. The issue is that I can't see a way to do this in googlecharts. I've tried:

 def min_and_max(series)
   return series.map{|a| a.min}.min, series.map{|a| a.max}.max
  end

xs = [0.upto(5).to_a, 0.upto(5).to_a]
ys = [0.upto(5).to_a, 0.upto(5).map{|x| x * 2}]
Gchart.line_xy(
               :data => xs.zip(ys).flatten(1),
               #:min_value => 0,
               #:max_value => 10,
               :axis_range => [min_and_max(xs), min_and_max(ys)],
               :axis_with_labels => 'x,y',
               :encoding => 'text'
               )

But that just generates chds=0,10. Am I missing something, or is this not supported? If the latter, I'm happy to patch, but how should it work?