Pie

Explore and open details

Select a region, open its detail and navigate back through the same data hierarchy.

Drilldown example

Explore the regionsSelect North and open its detail.40406060

Configuration

Set the maximum height at every level. In narrow containers, the circular plot stays square and its width limits the height.

Example code

Copy the example with its current settings.

Angular · TypeScript
import { ChartToolbarAction, ChartToolbarPosition } from '@neural-charts/angular';
import { Component } from '@angular/core';
import { NeuralChartDrilldown, type ChartDrilldownData, type ChartDrilldownOptions } from '@neural-charts/angular';

@Component({
  selector: 'app-regional-orders',
  imports: [NeuralChartDrilldown],
  template: '<nc-chart-drilldown [data]="data" [options]="options" instanceId="regional-orders" />'
})
export class RegionalOrders {
  readonly data: ChartDrilldownData = {
  "rootId": "regions",
  "nodes": [
    {
      "id": "regions",
      "data": {
        "type": "pie",
        "data": [
          {
            "id": "north",
            "label": "North",
            "value": 40
          },
          {
            "id": "south",
            "label": "South",
            "value": 60
          }
        ]
      }
    },
    {
      "id": "north",
      "data": {
        "type": "column",
        "axes": {
          "x": {
            "type": "category",
            "values": [
              {
                "id": "a",
                "label": "A"
              },
              {
                "id": "b",
                "label": "B"
              },
              {
                "id": "c",
                "label": "C"
              }
            ]
          },
          "y": {
            "type": "linear"
          }
        },
        "series": [
          {
            "id": "orders",
            "name": "Orders",
            "data": [
              {
                "id": "a",
                "x": "a",
                "y": 0
              },
              {
                "id": "b",
                "x": "b",
                "y": 10
              },
              {
                "id": "c",
                "x": "c",
                "y": 30
              }
            ]
          }
        ]
      }
    },
    {
      "id": "channel",
      "data": {
        "type": "donut",
        "data": [
          {
            "id": "online",
            "label": "Online",
            "value": 12
          },
          {
            "id": "store",
            "label": "Store",
            "value": 18
          }
        ]
      }
    }
  ],
  "links": [
    {
      "fromNodeId": "regions",
      "datumId": {
        "seriesId": "north",
        "pointId": "north"
      },
      "toNodeId": "north"
    },
    {
      "fromNodeId": "north",
      "datumId": {
        "seriesId": "orders",
        "pointId": "c"
      },
      "toNodeId": "channel"
    }
  ]
};
  readonly options: ChartDrilldownOptions = {
  chart: {
    "animation": {
      "enabled": true
    },
    "locale": "en",
    "theme": "light",
    toolbar: {
      actions: [ChartToolbarAction.Csv, ChartToolbarAction.Png, ChartToolbarAction.Svg],
      position: ChartToolbarPosition.Top,
    }
  },
  "nodes": {
    "regions": {
      "title": "Explore the regions",
      "description": "Select North and open its detail.",
      "height": 220,
      "legend": {
        "visible": true,
        "position": "bottom",
        "interactive": true
      },
      "appearance": {
        "colors": [
          "#2C6DCD",
          "#638A35"
        ],
        "dataLabels": true
      }
    },
    "north": {
      "title": "North · original breakdown",
      "description": "A: 0 · B: 10 · C: 30. Open C to see the channels.",
      "height": 220,
      "unit": "orders",
      "legend": {
        "position": "bottom"
      },
      "viewport": {
        "axes": "x",
        "controls": true
      },
      "appearance": {}
    },
    "channel": {
      "title": "C · channels",
      "height": 220,
      "unit": "orders",
      "legend": {
        "position": "bottom"
      },
      "appearance": {}
    }
  }
};
}

Data, options and events

Links use original IDs. Select a point and open its detail. Going back restores the previous view.

ChartDrilldownData

ChartDrilldownOptions

AngularDrilldown