Sanju Basnet
Sanju Basnet

Reputation: 136

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

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

Upvotes: 1

Views: 557

Answers (1)

Sanju Basnet
Sanju Basnet

Reputation: 136

Through the chartkick documentation I got the answer as:

 xtitle: "Time", ytitle: "Population"

adding line of code instead of library.

Upvotes: 1

Related Questions