0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【chart.js(v3.5.1)】でchartjs-plugin-colorschemesを使用する

Posted at

v3.51では以下のようなエラーで上手く動作しなかった

chartjs-plugin-colorschemes.js
 // [1] 1070行目あたり
 var ColorSchemesPlugin = {
        id: 'colorschemes',

        beforeUpdate: function (chart, options) {
            // ↓の行を追加
            var options = chart.config.options.plugins.colorschemes;


/////////////////////////////////////////////////////////////////////////////////

 // [2] 1190行目あたり
 //↓元々の行
 /*Chart.plugins.register(ColorSchemesPlugin);*/
 //↓の行のようにする
 (Chart.plugins || Chart).register(ColorSchemesPlugin);

以上の2点を変更すると動作するようになりました。

     

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?