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

XYAux

  • 名稱:X And Y Axes Auxiliary Line(X 及 Y 圖軸輔助線)

  • 說明:MultiValue 資料類別使用的 X, Y 軸輔助線

  • Playground 範例

params$

  • 型別:DeepPartial<XYAuxParams>

  • 欄位:

    名稱說明型別
    xAxisX 軸設定Object
    yAxisY 軸設定Object
  • params.xAxis, params.yAxis

  • 欄位:

    名稱說明型別
    showLine顯示輔助線boolean
    showLabel顯示輔助標籤boolean
    lineDashArray線條屬性 dash-arraystring
    lineColorType線條顏色類別ColorType
    labelColorType標籤顏色類別ColorType
    labelTextColorType標籤文字顏色類別ColorType
    labelTextFormat標籤文字函式string | ((text: any) => string)
    labelPadding標籤間距number
詳細型別
type ColorType = 'none' | 'label' | 'labelContrast' | 'primary' | 'secondary' | 'background'
  • 預設值:
{
  xAxis: {
    showLine: true,
    showLabel: true,
    lineDashArray: '3, 3',
    lineColorType: 'primary',
    labelColorType: 'primary',
    labelTextColorType: 'background',
    labelTextFormat: num => {
      if (num === null || Number.isNaN(num) == true) {
        return num || 0
      }
      const absNum = Math.abs(num)
      if (absNum > 0 && absNum < 1) {
        const strNum = num.toString()
        const match = strNum.match(/0\.(0*)([1-9])/)
        if (match) {
            const precision = match[1].length + 1
            return num.toFixed(precision)
        }
        return num.toString()
      }
      const parts = num.toString().split('.')
      parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
      return parts[0]
    },
    labelPadding: 20,
  },
  yAxis: {
    showLine: true,
    showLabel: true,
    lineDashArray: '3, 3',
    lineColorType: 'primary',
    labelColorType: 'primary',
    labelTextColorType: 'background',
    labelTextFormat: num => {
      if (num === null || Number.isNaN(num) == true) {
        return num || 0
      }
      const absNum = Math.abs(num)
      if (absNum > 0 && absNum < 1) {
        const strNum = num.toString()
        const match = strNum.match(/0\.(0*)([1-9])/)
        if (match) {
            const precision = match[1].length + 1
            return num.toFixed(precision)
        }
        return num.toString()
      }
      const parts = num.toString().split('.')
      parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',')
      return parts[0]
    },
    labelPadding: 20,
  }
}