Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i label gem "Chartkick" y & x axis?

Does Chartkick allow users to label the x/y axies?

     Sample Code:
     <%= line_chart Product.group("purchased").maximum(:price) %>
like image 964
elyrly Avatar asked Oct 25 '13 04:10

elyrly


1 Answers

Yes, with Google Charts, use:

<%= line_chart Product.group("purchased").maximum(:price), {library: {hAxis: {title: "X"}, vAxis: {title: "Y"}}} %>

like image 199
Andrew Kane Avatar answered Sep 19 '22 23:09

Andrew Kane