Charts

Bubble Chart

Learn how to implement and customize Bubble Charts in your Nuxt application.

Basic Usage

Props

PropTypeDefaultDescription
dataBubbleChartData[][]Array of data points for the chart.
categoriesRecord<string, BubbleCategory>{}Series configuration: name and color for each data key.
heightnumber300Height of the chart in pixels.
category-keystring''Key to access the category from the data item.
x-accessor(d: any) => any-Accessor function for x-axis values.
y-accessor(d: any) => any-Accessor function for y-axis values.
size-accessor(d: any) => any-Accessor function for bubble size.
x-formatter(tick: number) => string-Formats X-axis labels.
y-formatter`(v: numberDate) => string`-
legend-positionLegendPosition'none'Position of the legend.
y-domain-linebooleantrueShow the Y-axis domain line.

Data Format

The data should be an array of objects where each object represents a bubble.

types.ts
interface BubbleChartData {
  id: string
  title: string
  month: number
  viewingHours: number
  subscribers: number
  [key: string]: any
}

Categories Format

Categories define the visual appearance and metadata for each bubble series.

types.ts
interface BubbleCategory {
  name: string
  color: string
}

interface BubbleCategories {
  [key: string]: BubbleCategory
}