> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebuly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Chart

Returns the data for a single chart by ID.\
Chart IDs are returned by the [Get Report Data](/embedded-pages/reports/get-report-data) endpoint inside each report's `charts` array.

You need a **public API key** (`pk-...`) to authenticate. See [here](/embedded-pages/quickstart) for more information about API keys.

# Path parameters

<ParamField path="chart_id" type="string" required>
  The UUID of the chart.
</ParamField>

# Response

<ResponseField name="chart" type="object">
  The chart data. The shape depends on the chart type, identified by the `type` field.

  **Analytics chart**

  <Expandable title="analytics chart properties">
    <ResponseField name="type" type="string">
      The chart visualization type. Possible values: `line_chart`, `distributed`,
      `metric`, `horizontal_bar`, `vertical_bar`, `pie`, `scatter`.
    </ResponseField>

    <ResponseField name="id" type="string">
      The unique identifier (UUID) of the chart.
    </ResponseField>

    <ResponseField name="name" type="string">
      The display name of the chart.
    </ResponseField>

    <ResponseField name="variables" type="string[]">
      The metric variable slugs visualized by the chart (e.g.
      `["n_interactions"]`).
    </ResponseField>

    <ResponseField name="visualization_type" type="string | null">
      The sub-visualization type, if applicable (e.g. `"formula"` for metric
      charts).
    </ResponseField>

    <ResponseField name="display_type" type="string | null">
      How values are displayed. Either `"total"` or `"percentage"`.
    </ResponseField>

    <ResponseField name="x_label_values" type="string[]">
      The labels for the x-axis. For time series charts these are ISO 8601
      datetime strings; for categorical charts these are category names.
    </ResponseField>

    <ResponseField name="breakdown" type="string | null">
      The dimension used to split the chart into series, if any (e.g. `"topic"`,
      `"language"`).
    </ResponseField>

    <ResponseField name="granularity" type="string | null">
      The time granularity of the chart data. Possible values: `"hour"`, `"day"`,
      `"week"`, `"month"`.
    </ResponseField>

    <ResponseField name="time_range" type="object">
      The effective time range used to compute this chart's data.

      <Expandable title="properties">
        <ResponseField name="kind" type="string">
          The time range kind (see `timerange` query parameter for possible
          values).
        </ResponseField>

        <ResponseField name="start" type="string">
          ISO 8601 start datetime.
        </ResponseField>

        <ResponseField name="end" type="string">
          ISO 8601 end datetime.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="data" type="object[]">
      The datasets for the chart. Each dataset corresponds to one series (e.g. one
      breakdown value).

      <Expandable title="properties">
        <ResponseField name="label" type="string">
          The series label (e.g. the breakdown value or the variable name).
        </ResponseField>

        <ResponseField name="data" type="object[]">
          The data points for this series. Each entry corresponds to one x-axis
          value.

          <Expandable title="properties">
            <ResponseField name="x" type="number">
              The index position of this data point, corresponding to the entry at
              the same index in `x_label_values`.
            </ResponseField>

            <ResponseField name="y" type="number | null">
              The numeric value for this data point.
            </ResponseField>

            <ResponseField name="user" type="string | null">
              The user identifier, present only for user-level breakdowns.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>

  **Table chart**

  <Expandable title="table chart properties">
    <ResponseField name="type" type="string">
      Always `"table"` for table charts.
    </ResponseField>

    <ResponseField name="id" type="string">
      The unique identifier (UUID) of the chart.
    </ResponseField>

    <ResponseField name="name" type="string">
      The display name of the chart.
    </ResponseField>

    <ResponseField name="breakdowns" type="string[]">
      The dimension(s) used to group the table rows (e.g. `["topic"]`, `["topic", "language"]`).
    </ResponseField>

    <ResponseField name="columns" type="string[]">
      The metric column names present in each row (e.g. `["n_interactions", "n_users"]`).
    </ResponseField>

    <ResponseField name="rows" type="object[]">
      The table rows. Each row contains the breakdown dimension values and the metric values defined in `columns`.
    </ResponseField>
  </Expandable>
</ResponseField>
