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?

Grafanaの背景色を変える

Last updated at Posted at 2024-08-01

Grafanaでの背景色はテーマ変更で行うのですが、lightとDarkの2種類しかない。

管理者でログインしてDefault preferencesを選択
image.png

インターフェーステーマを選択
image.png

テーマを自分で追加できればいいのだが、テーマの作り方が分かっていないので、簡単な方法で実現してみました。

1)grafana.iniに以下を追加

HTMLのサニタライズを無効にする
grafana.iniは/etc/grafana/の下にある

[panels]
disable_sanitize_html = true

2) VisualizationsのTextをダッシュボードに貼り付ける

image.png

3) Textボックスの記述モードをHTMLにする

image.png

4) Textボックスに以下を記入する

<style>
  body {
    background-color: #66cdaa
  }
</style>

以下のようにVisualizationsの背景に色が付きます。

image.png

Textボックスがダッシュボードの中にないと有効になりませんが、styleタグが有効になったので後はcssのclassが分かればいろいろカスタマイズできるはず。

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?