본문 바로가기
WIKI 기술 지식 베이스

파이 차트 위젯

원문 보기 위키 갱신

파이 차트 위젯 (Pie Chart Widget)

출처: 문서

본문

파이 차트 위젯은 대응하는 비율이 있는 단일 데이터셋, 또는 중첩된 비율을 가진 여러 데이터셋을 표시할 수 있어요.

구성 (Configuration)

  1. 사용 가능한 데이터 소스에서 선택해요.
  2. 쿼리를 구성해요. 자세한 내용은 다음 리소스를 참고하세요.
    • 메트릭: 메트릭 쿼리를 구성하려면 쿼리 문서를 참고하세요.
    • 이벤트: 로그 이벤트 쿼리를 구성하려면 로그 검색 문서를 참고하세요.
  3. (선택) 공식(formula)으로 쿼리를 수정해요.
  4. 그래프를 사용자화해요.

그래프 사용자화 (Graph customization)

총계 표시 (Total amount display)

차트 중앙에 총 개수를 표시할지 여부를 전환해요. 기본적으로 자동(Automatic) 옵션은 그래프가 특정 크기에 도달하면 총 개수를 표시해요.

범례 구성 (Legend configuration)

범례는 끄거나, 비켜서(Aside) 옵션으로 차트 세그먼트 위에 직접 표시하거나, 각 값·색상·비율을 나열하는 테이블(Table)로 표시할 수 있어요.

기본적으로 자동(Automatic) 옵션은 대시보드 안에서 라벨이 붙은 Aside 범례를 표시하고, 전체 화면으로 열면 Aside와 Table 범례를 모두 표시해요.

컨텍스트 링크는 기본적으로 활성화되어 있으며 켜고 끌 수 있어요. 컨텍스트 링크는 대시보드 위젯을 다른 페이지(Datadog 내부 또는 타사)와 연결해줘요.

표시 및 상호작용 (Display and interaction)

필터 및 포커스 (Filter and focus)

한 번에 여러 데이터 그룹이 플롯되는 경우 단일 카테고리를 선택해서 그 안의 비율을 볼 수 있어요.

단일 카테고리를 보려면 카테고리 링의 바깥쪽 부분에 마우스를 올리고 클릭해요. 이전 뷰로 돌아가려면 차트 중앙으로 커서를 옮기고 클릭해요.

전체 화면 (Full-screen)

파이 차트 위젯을 전체 화면으로 보면 표준 전체 화면 옵션 세트가 표시돼요.

API

이 위젯은 **대시보드 API**와 함께 사용할 수 있어요. 위젯 JSON 스키마 정의에 대해서는 다음 표를 참고하세요.

파이 차트의 위젯 유형은 sunburst예요. 최상위 필드에는 다음이 있어요.

필드 타입 설명
custom_links object[] 사용자 지정 링크 목록.
is_hidden boolean 컨텍스트 메뉴 링크 표시 여부를 전환하는 플래그.
label string 사용자 지정 링크 URL의 라벨.
link string 사용자 지정 링크의 URL. http 또는 https를 포함해야 해요.
override_label string 컨텍스트 메뉴 링크를 나타내는 라벨 ID.
description string 위젯의 설명.
hide_total boolean 이 위젯에서 총계 값을 표시할지 여부.
legend object 범례 구성(테이블 기반 table,none 또는 인라인/자동 inline,automatic).
requests [필수] object[] sunburst 위젯 요청 목록.

requests 항목은 formulas, queries, q, 그리고 apm_query, audit_query, event_query, log_query 같은 (더 이상 사용되지 않는) 쿼리 필드를 포함할 수 있어요. 전체 예시는 다음과 같아요.

{
  "custom_links": [
    {
      "is_hidden": false,
      "label": "Search logs for {{host}}",
      "link": "https://app.datadoghq.com/logs?query={{host}}",
      "override_label": "logs"
    }
  ],
  "description": "string",
  "hide_total": false,
  "legend": {
    "type": "table"
  },
  "requests": [
    {
      "apm_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "audit_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "event_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "formulas": [
        {
          "alias": "string",
          "cell_display_mode": "number",
          "cell_display_mode_options": {
            "trend_type": "area",
            "y_scale": "shared"
          },
          "conditional_formats": [
            {
              "comparator": ">",
              "custom_bg_color": "string",
              "custom_fg_color": "string",
              "hide_value": false,
              "image_url": "string",
              "metric": "string",
              "palette": "blue",
              "timeframe": "string",
              "value": 0
            }
          ],
          "formula": "func(a) + b",
          "limit": {
            "count": "integer",
            "order": "asc"
          },
          "number_format": {
            "unit": {
              "per_unit_name": "bytes",
              "type": "canonical_unit",
              "unit_name": "bytes"
            },
            "unit_scale": {
              "type": "canonical_unit",
              "unit_name": "bytes"
            }
          },
          "style": {
            "palette": "classic",
            "palette_index": 1
          }
        }
      ],
      "log_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "network_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "process_query": {
        "filter_by": [],
        "limit": "integer",
        "metric": "system.load.1",
        "search_by": "string"
      },
      "profile_metrics_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "q": "string",
      "queries": [],
      "response_format": "timeseries",
      "rum_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "security_query": {
        "compute": {
          "aggregation": "avg",
          "facet": "@duration",
          "interval": 5000
        },
        "group_by": [
          {
            "facet": "resource_name",
            "limit": 50,
            "sort": {
              "aggregation": "avg",
              "facet": "@string_query.interval",
              "order": "desc"
            }
          }
        ],
        "index": "days-3,days-7",
        "multi_compute": [
          {
            "aggregation": "avg",
            "facet": "@duration",
            "interval": 5000
          }
        ],
        "search": {
          "query": ""
        }
      },
      "sort": {
        "count": "integer",
        "order_by": [
          {
            "index": 0,
            "order": "desc",
            "type": "formula"
          }
        ]
      },
      "style": {
        "palette": "string"
      }
    }
  ],
  "time": {
    "hide_incomplete_cost_data": false,
    "live_span": "5m"
  },
  "title": "string",
  "title_align": "string",
  "title_size": "string",
  "type": "sunburst"
}

더 알아보기 (Learn more)