0
2

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 5 years have passed since last update.

Highchartsでグラフの右下にデフォルトで表示されているクレジット「Highcharts.com」の削除・変更方法

Posted at

はじめに

データのビジュアライズにHighchartsを使っています。
Highchartsの公式サイトはこちら
Interactive JavaScript charts for your webpage | Highcharts

Highchartsは商用利用だと有償になりますが、簡単に見栄えの良いグラフが作れるので有償ならば一択な感じです。
どのようなグラフが作れるかはデモサイトが参考になります。
Highcharts demos | Highcharts

今回、グラフの右下にデフォルトで表示されているクレジット「Highcharts.com」の削除・変更方法を説明します。
図.png

クレジットの削除方法

チャート生成時のオプションに以下のように設定するだけです。

credits: {
    enabled: false
},

クレジットの変更方法(リンク有り)

チャート生成時のオプションに以下のように設定します。
リンク先も忘れずに設定します。

credits: {
    text: '© EXAMPLE, Inc.',
    href: 'https://www.example.com'
},

クレジットの変更方法(リンク無し)

チャート生成時のオプションに以下のように設定します。
リンク先を設定しない場合はstyleでcursorも無効にしておきます。

credits: {
    text: '© EXAMPLE, Inc.',
    href: null,
    style: {"cursor": "default", "color": "#999999", "fontSize": "10px"}
},

おわりに

データのビジュアライズには主にHighchartsとChart.js(たまにD3.js)を使っています。
豊富なオプションやサンプルがある点でChart.jsも優れたライブラリですが
商用利用は有償だけあって、Highchartsの方が豊富さは一歩抜き出ている気がします。
小さなことだったりしますが、躓いたところなどHighcharts関連も今後少しずつアップしていこうと思っています。

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?