In rails Label X and Y axis in chart. Implemented through chartkick and chart.js

Viewed 131

I want to keep label in my chart so that it will be descriptive. I have take reference of the chart from https://github.com/ankane/chartkick/issues/155 but doesn't work for me.

My code in the view is as:

               = line_chart @event_chart,discrete:true, legend: "bottom",curve: false,
           colors: ["#67b55e","#d43766","#729be0"],
          :library => {hAxis: {title: "months"}, vAxis: {title: "Y-label"}, title: "no. of events"}

My chart looks like:

line chart

1 Answers

Through the chartkick documentation I got the answer as:

 xtitle: "Time", ytitle: "Population"

adding line of code instead of library.

Related