OrbCharts Docs
Docs
Home
Github
  • English
  • 繁體中文
Docs
Home
Github
  • English
  • 繁體中文
  • Guide
  • Basic Concepts

    • 6 Data Formats
    • Core Technologies
  • Get Started !

    • Installation
    • Examples
  • Basic Usage

    • Creating Charts
    • Using Presets
    • Drawing Charts
    • Data Labels
  • Chart API

    • plugins$
    • data$
    • chartParams$
    • dataFormatter$
    • event$
    • destroy()
  • Plugins

    • Create Plugin
    • Series

      • Bubbles
      • Pie
      • PieEventTexts
      • PieLabels
      • Rose
      • RoseLabels
      • SeriesLegend
      • SeriesTooltip
    • Grid

      • Bars
      • BarsPN
      • BarsTriangle
      • Dots
      • GridLegend
      • GridTooltip
      • GroupAux
      • GroupAxis
      • GroupZoom
      • Lines
      • LineAreas
      • StackedBars
      • StackedValueAxis
      • ValueAxis
    • MultiGrid

      • MultiBars
      • MultiBarsTriangle
      • MultiDots
      • MultiGridLegend
      • MultiGridTooltip
      • MultiGroupAxis
      • MultiStackedBars
      • MultiStackedValueAxis
      • MultiValueAxis
      • OverlappingValueAxes
      • OverlappingStackedValueAxes
    • MultiValue

      • MultiValueLegend
      • MultiValueTooltip
      • OrdinalAux
      • OrdinalAxis
      • OrdinalBubbles
      • OrdinalZoom
      • RacingBars
      • RacingCounterTexts
      • RacingValueAxis
      • Scatter
      • ScatterBubbles
      • XYAux
      • XYAxes
      • XYZoom
    • Relationship

      • ForceDirected
      • ForceDirectedBubbles
      • RelationshipLegend
      • RelationshipTooltip
    • Tree

      • TreeLegend
      • TreeMap
      • TreeTooltip

Bubbles

  • Name: Bubble Chart

  • Description: Suitable for presenting the names and quantities of individual data points

  • Playground Example

params$

  • Type: DeepPartial<BubblesParams>

  • Fields:

    NameDescriptionType
    forceSettings for d3-forceObject
    bubbleLabelDisplay settings for data labelObject
    arcScaleTypeMapping method for calculating bubble area using value. area maps data to bubble area, radius maps data to bubble radius (the latter will cause more significant area differences, but the visual accuracy may be controversial)'area' | 'radius'
  • params.force

    NameDescriptionType
    strengthBubble forcenumber
    velocityDecayVelocity decaynumber
    collisionSpacingBubble spacingnumber
  • params.bubbleLabel

    NameDescriptionType
    labelFnFunction to display label text(d: ComputedDatumSeries) => string
    colorTypeLabel color typeColorType
    fillRateFill rate of label text within the bubble (if 1, it fills completely without gaps)number
    lineHeightLine height of label text (if 1, it is equal to the text height)number
    maxLineLengthMaximum number of characters per line of label text (if exceeded, it forces a line break)number
    wordBreakAllWhether to force line breaks even without space characters (if the label content uses non-English characters - such as Chinese, it may not be able to line break if there are no space characters, and setting this to false will prevent line breaks)boolean
Detailed Types
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'

interface ComputedDatumSeries {
  id: string
  index: number
  label: string
  visible: boolean
  data: any
  value: number | null
  color: string
  seriesIndex: number
  seriesLabel: string
  seq: number
}
  • Default values:
{
  force: {
    strength: 0.08,
    velocityDecay: 0.3,
    collisionSpacing: 2
  },
  bubbleLabel: {
    labelFn: d => String(d.label),
    colorType: 'labelContrast',
    fillRate: 0.6,
    lineHeight: 1,
    maxLineLength: 6,
    wordBreakAll: true,
  },
  arcScaleType: 'area'
}