Reputation: 8730
I want to show only integers in YAxis
PaymentTransaction.group_by_day(:created_at, format: "%b %d, %Y").count,discrete: true, allowDecimals: false,yAxis: {allowDecimals: false}
Upvotes: 0
Views: 352
Reputation: 3106
If you use Google Charts then you can do it like this:
data = PaymentTransaction.group_by_day(:created_at, format: "%b %d, %Y").count
y = data.map(&:last)
y_discrete = ((y.min.floor)..(y.max.ceil)).to_a
options = { vAxis: { ticks: y_discrete } }
line_chart(data, { library: options })
Upvotes: 1