生态产品多个设计器现已发布候选版本

查看生态总览
Skip to content

RadarChart new ​

Charts component. This page is the API reference, generated from the source code. Usage guidance and live examples are on the Chinese page.

Anatomy ​

Parts in bold are required.

data-scope="radar-chart": root · caption · legend · legend-item · legend-swatch · legend-label · viewport · plot · defs · pattern · pattern-line · grid-ring · ring-label · spoke · indicator-label · series · area-fill · line · point · crosshair · focus-ring · tooltip · tooltip-header · tooltip-row · tooltip-swatch · tooltip-value · tooltip-name · empty · summary · table-region · table

API reference ​

Descriptions of individual props, events and slots are written in Chinese and appear on the Chinese page.

Artifacts ​

LayerValue
Custom element<xh-radar-chart>
Vue componentsXhRadarChartCaption XhRadarChartEmpty XhRadarChartLegend XhRadarChartPlot XhRadarChartRoot XhRadarChartTooltip XhRadarChartViewport
ComposableuseRadarChart
State machineradarChartMachine
Skin@xihan-ui/styles/radar-chart.css

Events ​

Custom elements put the payload in detail; Vue emits an event of the same name.

EventPayload
hidden-series-changeChartHiddenSeriesChangeDetails
active-key-changeChartActiveKeyChangeDetails
datum-activeChartDatumDetails
datum-pressChartDatumDetails

Slots ​

Only slots with a payload are listed.

Vue componentSlotPayload
XhRadarChartRootdefaultRadarChartRootSlotProps
XhRadarChartRootcaption—
XhRadarChartRoottooltipRadarChartTooltipSlotProps
XhRadarChartRootempty—
XhRadarChartTooltipdefaultRadarChartTooltipSlotProps

React adapter props ​

Only the props each component declares itself: DOM attributes inherited from ComponentPropsWithRef are left out, and root props already listed in the Props table are not repeated. The Vue counterpart is the slot table above.

React componentPropTypeRequired
XhRadarChartRootdatareadonly ChartRow[]
XhRadarChartRootnameFieldstring
XhRadarChartRootindicatorsreadonly RadarIndicator[]
XhRadarChartRootshapeRadarShape
XhRadarChartRootareaboolean
XhRadarChartRootscaleRadarScale
XhRadarChartRootcurveRadarCurve
XhRadarChartRootringsnumber
XhRadarChartRootringLabelsboolean
XhRadarChartRootformatNumberFormatSpec | ((value: number) => string)
XhRadarChartRoothiddenSeriesstring[]
XhRadarChartRootdefaultHiddenSeriesstring[]
XhRadarChartRootactiveKeyChartKey | null
XhRadarChartRootpendingboolean
XhRadarChartRootanimatedboolean
XhRadarChartRootlocalestring
XhRadarChartRoottranslationsPartial<RadarChartTranslations>
XhRadarChartRootonHiddenSeriesChangeRadarChartProps['onHiddenSeriesChange']
XhRadarChartRootonActiveKeyChangeRadarChartProps['onActiveKeyChange']
XhRadarChartRootonDatumActiveRadarChartProps['onDatumActive']
XhRadarChartRootonDatumPressRadarChartProps['onDatumPress']
XhRadarChartRootcaptionReactNode
XhRadarChartRootrenderTooltip(props: RadarChartTooltipSlotProps) => ReactNode
XhRadarChartRootemptyReactNode
XhRadarChartRootchildrenSlotChildren<RadarChartRootSlotProps>
XhRadarChartTooltipchildrenSlotChildren<RadarChartTooltipSlotProps>

State ​

Public state is written to data-state.

PartValues
root'error' | undefined
tooltip'visible' | 'hidden'
empty'loading' | undefined

The following names are internal to the state machine.

States: idle

connect API ​

getXxxProps() returns the host attributes of the matching part.

MemberType
modelRadarModel
sceneScene
overlayRadarOverlay
measuredboolean
emptyboolean
legendItemsreadonly RadarLegendItem[]
patternsreadonly ChartPattern[]
activeChartDatumDetails | null
tooltipRadarTooltipModel | null
summarystring
tableTableModel
emptyTextstring
tableCaptionstring
activeKeyChartKey | null
hiddenSeriesstring[]
toggleSeries(id: string) => void
setFocusedDatum(ref: { seriesId: string, index: number } | null) => void
markTag(mark: Mark) => RadarMarkTag
getRootProps() => T['element']
getCaptionProps() => T['element']
getLegendProps() => T['element']
getLegendItemProps(item: RadarLegendItem) => T['button']
getLegendSwatchProps(item: RadarLegendItem) => T['element']
getLegendLabelProps(item: RadarLegendItem) => T['element']
getViewportProps() => T['element']
getPlotProps() => T['element']
getDefsProps() => T['element']
getPatternProps(pattern: ChartPattern) => T['element']
getPatternLineProps(pattern: ChartPattern) => T['element']
getMarkProps(mark: Mark) => T['element']
getTooltipProps() => T['element']
getTooltipHeaderProps() => T['element']
getTooltipRowProps(row: RadarTooltipRow) => T['element']
getTooltipSwatchProps(row: RadarTooltipRow) => T['element']
getTooltipValueProps(row: RadarTooltipRow) => T['element']
getTooltipNameProps(row: RadarTooltipRow) => T['element']
getEmptyProps() => T['element']
getSummaryProps() => T['element']
getTableRegionProps() => T['element']
getTableProps() => T['element']

Accessibility ​

Keyboard ​

Specification: W3C APG. Each row is a stable behavior id that the conformance tests cover; the conditions and effects are described on the Chinese page.

KeysBehavior
Tab / Shift+Tabradar-chart.kbd.tab
ArrowRightradar-chart.kbd.next
ArrowLeftradar-chart.kbd.prev
ArrowUpradar-chart.kbd.series-next
ArrowDownradar-chart.kbd.series-prev
Home / PageUpradar-chart.kbd.first
End / PageDownradar-chart.kbd.last
Enter / Spaceradar-chart.kbd.press
Escaperadar-chart.kbd.dismiss
ArrowLeft / ArrowRight / Home / Endradar-chart.kbd.legend-move
Enter / Spaceradar-chart.kbd.legend-toggle

ARIA ​

These attributes are produced by connect.

PartAttributeValue
rootaria-busy'true' | undefined
legendaria-labeltranslations.legendLabel
legendrole'toolbar'
legend-itemaria-pressed'false' | 'true'
legend-swatcharia-hidden'true'
plotaria-describedbyid of the summary part
plotaria-roledescriptiontranslations.chartRoleDescription
plotrole'graphics-document'
tooltiparia-hidden'true'
markaria-hidden'true'
markaria-labelundefined | s?.name
markaria-roledescriptionundefined | translations.seriesRoleDescription
markroleundefined | 'graphics-object'

Style reference ​

Skin ​

@xihan-ui/styles/radar-chart.css is written against [data-scope="radar-chart"][data-part="root"] part selectors; the published build uses the mount class .xh-scope-radar-chart in place of data-scope (same specificity) and sits in the xihan.components layer. Put overrides in xihan.overrides; the part selectors work as usual.

Data attributes ​

Produced by connect; valueless attributes are omitted while their condition does not hold.

PartAttributeValue
rootdata-loading'' (present only while the condition holds)
rootdata-state'error' | undefined
rootdata-xh-chart-part'root'
captiondata-xh-chart-part'caption'
legenddata-xh-chart-part'legend'
legend-itemdata-pressed'' (present only while the condition holds)
legend-itemdata-valueitem.id
legend-itemdata-xh-action-control''
legend-itemdata-xh-action-profile'text'
legend-itemdata-xh-action-size'xs'
legend-itemdata-xh-action-variant'ghost'
legend-itemdata-xh-chart-part'legend-item'
legend-itemdata-xh-chart-patternString(item.slot)
legend-itemdata-xh-chart-slotString(item.slot)
legend-swatchdata-xh-chart-part'legend-swatch'
viewportdata-xh-chart-part'viewport'
plotdata-xh-chart-part'plot'
defsdata-xh-chart-part'defs'
patterndata-xh-chart-part'pattern'
patterndata-xh-chart-slotundefined | String(pattern.slot)
pattern-linedata-xh-chart-part'pattern-line'
tooltipdata-placement'top' | 'bottom'-'right' | 'left' | undefined
tooltipdata-state'visible' | 'hidden'
tooltipdata-xh-chart-part'tooltip'
tooltip-headerdata-xh-chart-part'tooltip-header'
tooltip-rowdata-current'' (present only while the condition holds)
tooltip-rowdata-series-idrow.seriesId
tooltip-rowdata-xh-chart-part'tooltip-row'
tooltip-rowdata-xh-chart-patternString(row.slot)
tooltip-rowdata-xh-chart-slotString(row.slot)
tooltip-swatchdata-xh-chart-part'tooltip-swatch'
tooltip-valuedata-xh-chart-part'tooltip-value'
tooltip-namedata-xh-chart-part'tooltip-name'
emptydata-loading'' (present only while the condition holds)
emptydata-state'loading' | undefined
emptydata-xh-chart-part'empty'
emptydata-xh-loading-ring''
markdata-dimmed'' (present only while the condition holds)
markdata-series-idmark.key.slice('series:'.length)
markdata-xh-chart-partmark.part | undefined
markdata-xh-chart-slotString(s.slot) | undefined | String(mark.paint.slot)

CSS variables ​

The public override slots, generated from what the standalone skin actually consumes.

VariablePartCSS propertyStateDefault from
--xh-radar-chart-empty-gapemptygapstate=loading--xh-space-2
--xh-radar-chart-gaprootgapdefault--xh-space-3
--xh-radar-chart-heightviewportblock-sizedefault--xh-chart-height
--xh-radar-chart-legend-gaplegendgapdefault--xh-space-1
--xh-radar-chart-legend-swatch-radiuslegend-swatchborder-radiusdefault--xh-shape-inset
--xh-radar-chart-line-widthlegend-swatch
line
root
tooltip-swatch
background
block-size
stroke-dasharray
stroke-width
@media (forced-colors: active)
@media print
default
mark=line
where([data-xh-chart-patterns])
xh-chart-pattern
xh-chart-pattern=2
xh-chart-pattern=3
xh-chart-pattern=4
xh-chart-pattern=5
xh-chart-pattern=6
xh-chart-pattern=7
xh-chart-pattern=8
xh-chart-patterns
--xh-chart-line-width
--xh-radar-chart-point-sizelegend-swatch
root
tooltip-swatch
background@media (forced-colors: active)
@media print
where([data-xh-chart-patterns])
xh-chart-pattern
xh-chart-pattern=1
xh-chart-pattern=2
xh-chart-pattern=3
xh-chart-pattern=4
xh-chart-pattern=5
xh-chart-pattern=6
xh-chart-pattern=7
xh-chart-pattern=8
xh-chart-patterns
--xh-chart-point-size
--xh-radar-chart-ring-label-fgring-labelfilldefault--xh-chart-label
--xh-radar-chart-ring-label-opacityring-labelopacitydefault0.8
--xh-radar-chart-series-colorarea-fill
legend-swatch
line
pattern-line
point
tooltip-swatch
background
border
fill
stroke
@media (forced-colors: active)
@media print
mark=line
where([data-xh-chart-patterns])
xh-chart-pattern
xh-chart-pattern=1
xh-chart-pattern=2
xh-chart-pattern=3
xh-chart-pattern=4
xh-chart-pattern=5
xh-chart-pattern=6
xh-chart-pattern=7
xh-chart-pattern=8
xh-chart-patterns
xh-chart-slot=1
xh-chart-slot=2
xh-chart-slot=3
xh-chart-slot=4
xh-chart-slot=5
xh-chart-slot=6
xh-chart-slot=7
xh-chart-slot=8
--xh-chart-categorical-1
--xh-chart-categorical-2
--xh-chart-categorical-3
--xh-chart-categorical-4
--xh-chart-categorical-5
--xh-chart-categorical-6
--xh-chart-categorical-7
--xh-chart-categorical-8
--xh-radar-chart-tooltip-gaptooltipgapdefault--xh-space-1
--xh-radar-chart-tooltip-pxtooltippadding-inlinedefault--xh-surface-pad-sm
--xh-radar-chart-tooltip-pytooltippadding-blockdefault--xh-surface-pad-sm
--xh-radar-chart-tooltip-radiustooltipborder-radiusdefault--xh-shape-overlay
--xh-radar-chart-tooltip-row-gaptooltip-rowgapdefault--xh-space-2
--xh-radar-chart-tooltip-shadowtooltipbox-shadowdefault--xh-material-frosted-shadow
--xh-radar-chart-tooltip-swatch-radiustooltip-swatchborder-radiusdefault--xh-shape-inset

Released under The MIT License