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

PieLabels

  • Name: Pie Labels

  • Description: Suitable for use with Pie, displays data labels

  • Usage: The data in data$ must have a label field to display the label text

Example:

chart.data$.next([
  [
    {
      label: 'Taipei',
      value: 50000
    },
    {
      label: 'Taichung',
      value: 40000
    },
    {
      label: 'Kaohsiung',
      value: 30000
    }
  ]
])
  • Playground Example

params$

  • Type: Partial<PieLabelsParams>

  • Fields:

    NameDescriptionType
    outerRadiusDrawing functionnumber
    outerRadiusWhileHighlightText (line) attributenumber
    startAngleStarting angle of the arcnumber
    endAngleEnding angle of the arcnumber
    labelCentroidRelative position of the label at the center of the arc radius (0 is the center of the circle, 2 is the edge of the circle)number
    labelColorTypeLabel color typeColorType
    labelFnFunction to display label text(d: ComputedDatumSeries) => string
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:
{
  outerRadius: 0.85,
  outerRadiusWhileHighlight: 0.9,
  startAngle: 0,
  endAngle: Math.PI * 2,
  labelCentroid: 2.1,
  labelColorType: 'primary',
  labelFn: d => String(d.label),
}