LoginSignup
0
0

More than 1 year has passed since last update.

【Rails】chartkickのlinechart、Y軸を反転させるオプション

Posted at

はじめに

chartkickでline_chartを実装してランキング表示をしてましたが、知らんうちにY軸反転が効かなくなってました。
自分の環境ではchart.jsの仕様変更っぽかったので、メモしておきます。

環境

  • Rails 5.2
  • Ruby 2.7.6
  • chartkick (4.2.0)

変更点

library: { scales:{ yAxes: [{ ticks: { reverse: true, } }] } }

で動いていたのが、2022年7月に動かなくなってましたが、

library: { scales:{ y: { reverse: true} } }

で動くようになりました。

……最初からこうしておいてくれよ!w

終わり

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0