Skip to main content

VictoryChart

Inherited Props


backgroundComponent

type: ReactElement

The backgroundComponent prop takes a component instance which will be responsible for rendering a background if the VictoryChart's style component includes background styles. The new element created from the passed backgroundComponent will be provided with the following properties calculated by VictoryChart: height, polar, scale, style, x, y, width. All of these props on Background should take precedence over what VictoryChart is trying to set.

Live View
Loading...
Live Editor

children

type: ReactElement | ReactElement[]

VictoryChart works with any combination of the following children: [VictoryArea][], [VictoryAxis][] / [VictoryPolarAxis][], [VictoryBar][], [VictoryCandlestick][], [VictoryErrorBar][], [VictoryGroup][], [VictoryLine][], [VictoryScatter][], [VictoryHistogram][], [VictoryStack][], and [VictoryVoronoi][]. Children supplied to VictoryChart will be cloned and rendered with new props so that all children share common props such as domain and scale.

note

polar charts must use VictoryPolarAxis rather than VictoryAxis


containerComponent

type: ReactElement

VictoryChart uses the standard containerComponent prop. Read about it in detail here

containerComponent={<VictoryVoronoiContainer/>}

desc

type: string

The desc prop specifies the description of the chart/SVG to assist with accessibility for screen readers. The more descriptive this title is, the more useful it will be for people using screen readers.


defaultAxes

type: { independent: ReactElement; dependent: ReactElement }

Set the default axis for this chart when no axis is provided. Allows you to customize the axis component for the chart.

note

This property is not typically used

// default
defaultAxes = {
independent: <VictoryAxis />,
dependent: <VictoryAxis dependentAxis />
}

defaultPolarAxes

type: { independent: ReactElement; dependent: ReactElement }

Set the default axis for this chart when no axis is provided. Allows you to customize the axis component for the chart.

note

This property is not typically used

// default
defaultPolarAxes ={
independent: <VictoryPolarAxis />,
dependent: <VictoryPolarAxis dependentAxis />
}

domain

type: array[low, high] || { x: [low, high], y: [low, high] }default: calculated from data

The domain prop describes the range of data the component will include. This prop can be given as an array of the minimum and maximum expected values of the data or as an object that specifies separate arrays for x and y. If this prop is not provided, a domain will be calculated from data, or other available information.

note

VictoryChart controls the domain prop of its children.


endAngle

type: numberdefault: 360

The endAngle props defines the overall end angle of a polar chart in degrees. This prop is used in conjunction with startAngle to create polar chart that spans only a segment of a circle, or to change overall rotation of the chart. This prop should be given as a number of degrees. Degrees are defined as starting at the 3 o'clock position, and proceeding counterclockwise.

Live View
Loading...
Live Editor

events

type: any[]

VictoryChart uses the standard events prop. Read about it in more detail here

See the [Events Guide][] for more information on defining events.

note

VictoryChart coordinates events between children using the VictorySharedEvents and the sharedEvents prop

Live View
Loading...
Live Editor

innerRadius

type: number

When the innerRadius prop is set, polar charts will be hollow rather than circular.

Live View
Loading...
Live Editor

prependDefaultAxes

type: numberdefault: true

By default, VictoryChart will prepend default axes to the beginning of the children array. This behavior can be disabled by setting prependDefaultAxes to false.


startAngle

type: numberdefault: 0

The startAngle props defines the overall start angle of a polar chart in degrees. This prop is used in conjunction with endAngle to create polar chart that spans only a segment of a circle, or to change overall rotation of the chart. This prop should be given as a number of degrees. Degrees are defined as starting at the 3 o'clock position, and proceeding counterclockwise.

Live View
Loading...
Live Editor

style

type: VictoryStyleInterfacedefault: (provided by theme)

Defines the style of the component using VictoryStyleInterface.

note: custom valid svg style properties that are supported may be included in background styles.

default (provided by default theme): See [grayscale theme][] for more detail

Live View
Loading...
Live Editor

title

type: string

The title prop specifies the title to be applied to the SVG to assist with accessibility for screen readers. The more descriptive this title is, the more useful it will be for people using screen readers