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

Axis labels not showing up correctly #63

Open
altla opened this issue Apr 11, 2013 · 0 comments
Open

Axis labels not showing up correctly #63

altla opened this issue Apr 11, 2013 · 0 comments

Comments

@altla
Copy link

altla commented Apr 11, 2013

I'm having some problems showing the right labels on the x axis.
For example, even this line of code that comes straight from the gem page, only shows '300' on the x axis, and it shows where 0 should go.

Gchart.line(:data => [300, 100, 30, 200, 100, 200, 300, 10],
:axis_with_labels => ['x','y','r'])

http://chart.apis.google.com/chart?chxt=x,y,r&chd=s:9UGpUp9C&cht=lc&chs=300x200&chxr=0,300,300

I'm also having problems with small changes in the y-values, for example this graph, shows all the x axis labels at the first position on top of each other, making them unreadable:

@chart = Gchart.line(
  :title  => @activity.name,
  :bg     => 'ffffff',
  :data   => [1,0,1],
  :axis_with_labels => 'x',
  :axis_labels => ['Jan|July|Jan'],
  :width => 900  
)

http://chart.apis.google.com/chart?chxl=0:|Jan|July|Jan&chxt=x&chf=bg,s,ffffff&chd=s:9A9&chtt=GSM+crediet&cht=lc&chs=900x200&chxr=0,1,1

Changing chxr in the url to chxr=3,1,1 fixes the problem but this if the data has some larger values like :data => [1,0,3] that's not even necessary.

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