Säulendiagramm mit Drilldown

Klicken Sie auf eine Region, um ihre Länder zu sehen, und dann auf ein Land, um dessen Städte aufzurufen.

Chart type
Bar bar
Tier
Kostenloser Core
Collection
Drilldown
Zeichnen
Live im Website-Design
.md ansehen Agenten einrichten
LIVE/drilldown/column-with-drilldown2 of 10 in Drilldown

Configuration

Original Standalone
const options = {
  chart: {
    height: 380,
    fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
    type: "bar",
    toolbar: {
      show: false
    }
  },
  series: [
    {
      name: "Revenue k€",
      data: [
        {
          x: "Europe",
          y: 420,
          drilldown: "Europe"
        },
        {
          x: "Americas",
          y: 380,
          drilldown: "Americas"
        },
        {
          x: "Asia",
          y: 510,
          drilldown: "Asia"
        },
        {
          x: "Africa",
          y: 140,
          drilldown: "Africa"
        }
      ]
    }
  ],
  plotOptions: {
    bar: {
      borderRadius: 4,
      columnWidth: "50%"
    }
  },
  dataLabels: {
    enabled: false
  },
  drilldown: {
    enabled: true,
    series: [
      {
        id: "Europe",
        name: "Europe by country",
        data: [
          {
            x: "DE",
            y: 112,
            drilldown: "DE"
          },
          {
            x: "FR",
            y: 108,
            drilldown: undefined
          },
          {
            x: "ES",
            y: 104,
            drilldown: undefined
          },
          {
            x: "IT",
            y: 96,
            drilldown: undefined
          }
        ]
      },
      {
        id: "DE",
        name: "DE by city",
        data: [
          {
            x: "Berlin",
            y: 22
          },
          {
            x: "Munich",
            y: 40
          },
          {
            x: "Hamburg",
            y: 50
          }
        ]
      },
      {
        id: "Americas",
        name: "Americas by country",
        data: [
          {
            x: "US",
            y: 82,
            drilldown: "US"
          },
          {
            x: "CA",
            y: 60,
            drilldown: undefined
          },
          {
            x: "BR",
            y: 130,
            drilldown: undefined
          },
          {
            x: "MX",
            y: 108,
            drilldown: undefined
          }
        ]
      },
      {
        id: "US",
        name: "US by city",
        data: [
          {
            x: "Austin",
            y: 34
          },
          {
            x: "Seattle",
            y: 21
          },
          {
            x: "Denver",
            y: 28
          }
        ]
      },
      {
        id: "Asia",
        name: "Asia by country",
        data: [
          {
            x: "JP",
            y: 124,
            drilldown: "JP"
          },
          {
            x: "IN",
            y: 138,
            drilldown: undefined
          },
          {
            x: "KR",
            y: 124,
            drilldown: undefined
          },
          {
            x: "SG",
            y: 124,
            drilldown: undefined
          }
        ]
      },
      {
        id: "JP",
        name: "JP by city",
        data: [
          {
            x: "Tokyo",
            y: 27
          },
          {
            x: "Osaka",
            y: 53
          },
          {
            x: "Nagoya",
            y: 44
          }
        ]
      },
      {
        id: "Africa",
        name: "Africa by country",
        data: [
          {
            x: "NG",
            y: 21,
            drilldown: undefined
          },
          {
            x: "ZA",
            y: 46,
            drilldown: undefined
          },
          {
            x: "KE",
            y: 39,
            drilldown: undefined
          },
          {
            x: "EG",
            y: 34,
            drilldown: undefined
          }
        ]
      }
    ],
    animation: {
      zoomFromPoint: true
    }
  },
  title: {
    text: "Revenue by region (click a column)"
  },
  theme: {
    mode: "light",
    preset: "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()