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

Line chart stretching data sets #59

Open
bengreville opened this issue Jul 4, 2012 · 1 comment
Open

Line chart stretching data sets #59

bengreville opened this issue Jul 4, 2012 · 1 comment

Comments

@bengreville
Copy link

More of a question than anything...
How do you stop two lines from stretching to be the same length if one contains less data than the other.
For instance my data is:

[[17, 28, 49, 59, 62], [24, 40, 52, 63]]

which produces this:

http://chart.apis.google.com/chart?chxt=x,y&chco=375987,e35a27,e58e6f,6b8baa&chf=bg,s,ffffff|c,s,FFFFFF&chd=s:Qbw69,Xnz9&cht=lc&chs=760x380&chxr=0,0,5,0|1,0,63,12

What I need is the orange line to end at 4 on the x axis.
Any help on this is much appreciated, thanks in advance.

@bengreville
Copy link
Author

Issue resolved: needed to do a bit of data manipulation before generating the graph. As a reference for anyone with this problem in the future, add nulls to the data sets you want shortened until it equals the largest data set in your array. For example:

[[17, 28, 49, 59, 62], [24, 40, 52, 63, nil]]
OR
[[17, 28, 49, 59, 62], [24, 40, 52, 63, nil], [15, 64, nil, nil, nil]]

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