OrbCharts 文件
文件
返回首頁
Github
  • English
  • 繁體中文
文件
返回首頁
Github
  • English
  • 繁體中文
  • 指南
  • 基本概念

    • 6種資料格式
    • 核心技術
  • 快速開始 !

    • 安裝
    • 範例
  • 基礎使用

    • 建立圖表
    • 使用預設集(Preset)
    • 繪製圖表
    • 資料標籤
  • 圖表 API

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

    • 建立 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

RacingCounterTexts

  • 名稱:RacingCounterTexts(計數顯示文字)

  • 說明:主要是用來搭配 RacingBars 使用的計數器顯示文字。

  • 使用方式:文字會對應 dataFormatter.xAxis.valueLabels[],依照目前計數器的數字對應到 valueLabels[] 陣列中相對應的文字。如果 valueLabels[] 沒有設定文字的話,預設就會以數字方式以 0 跑到 value 的最後一筆的筆數。

  • Playground 範例

params$

  • 型別:Partial<RacingCounterTextsParams>

  • 欄位:

    名稱說明型別
    renderFn文字顯示函式,如果回傳值為陣列則顯示為多行文字(valueLabel: string, valueIndex: number, data: ComputedDataMultiValue) => string[] | string
    textAttrs每行文字的 attributeArray<{ [key:string]: string | number }>
    textStyles每行文字的 styleArray<{ [key:string]: string | number }>
    paddingRight右邊間距number
    paddingBottom下面間距number
詳細型別
export type ComputedDataMultiValue = ComputedDatumMultiValue[][]

interface ComputedDatumMultiValue {
  id: string
  index: number
  label: string
  visible: boolean
  data: any
  datumIndex: number
  value: number[]
  color: string
  categoryIndex: number
  categoryLabel: string
}
  • 預設值:
{
  renderFn: (valueLabel: string, valueIndex: number, data: ComputedDataTypeMap<'multiValue'>) => {
    return valueLabel
  },
  textAttrs: [
    {
      "transform": "translate(0, 0)"
    }
  ],
  textStyles: [
    {
      "font-weight": "bold",
      "text-anchor": "end",
      "pointer-events": "none",
      "dominant-baseline": "auto",
      "font-size": 64,
      "fill": "#bebebe"
    },
    {
      "text-anchor": "end",
      "pointer-events": "none",
      "dominant-baseline": "auto",
      "font-size": 24,
      "fill": "#bebebe"
    },
  ],
  paddingRight: 0,
  paddingBottom: 0
}