Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Data scaling for line_xy #22

Open
icambron opened this issue Aug 3, 2010 · 0 comments
Open

Data scaling for line_xy #22

icambron opened this issue Aug 3, 2010 · 0 comments

Comments

@icambron
Copy link

icambron commented Aug 3, 2010

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant