Skip to main content

VictoryArea

info

For examples of VictoryArea in action, visit the Area Chart examples.

Inherited Props

Component Props


dataComponent

type: ReactElementdefault: <Area>

VictoryArea overrides the standard dataComponent prop and supplies the following props to its dataComponent:

  • data
  • events
  • groupComponent
  • interpolation
  • origin (for polar charts)
  • polar
  • scale
  • style
note

Because VictoryArea renders a single element to represent the entire dataset, the dataComponent it renders will not have access to datum like the dataComponent elements rendered by other Victory components such as VictoryScatter.


eventKey

type: string | number | string[] | number[] | (args: CallbackArgs) => string | number

VictoryArea uses the standard eventKey prop. Read about the eventKey prop in more detail here

note

VictoryArea only renders one element per dataset, so only one event key will be generated.


events

type: array[object]

VictoryArea uses the standard events prop. Read about it in detail

See the Events Guide for more information on defining events.

note

VictoryArea uses the special eventKey "all" rather than referring to data by index, as it renders only one element for an entire dataset

Live View
Loading...
Live Editor

groupComponent

type: ReactElementdefault: <VictoryClipContainer>

VictoryArea uses the standard groupComponent prop. Read about it in detail

note

VictoryArea uses VictoryClipContainer as its default groupComponent VictoryClipContainer renders a <g> tag with a clipPath def. This allows continuous data components to transition smoothly when new data points enter and exit.

warning

Using a custom groupComponent with VictoryArea may result in broken animations.

Live View
Loading...
Live Editor

interpolation

type: InterpolationPropType | Functiondefault: "linear"

The interpolation prop determines how data points should be connected when creating a path. Victory uses d3-shape for interpolating curves.

Interpolation Options

Both cartesian and polar charts may use the following interpolation options:

  • "basis"
  • "cardinal"
  • "catmullRom"
  • "linear"

Cartesian charts may also use the following interpolation options:

  • "monotoneX"
  • "monotoneY"
  • "natural"
  • "step"
  • "stepAfter"
  • "stepBefore"

You can also provide a custom curve function.

Live View
Loading...
Live Editor

labelComponent

type: ReactElementdefault: <VictoryLabel renderInPortal />

VictoryArea uses the standard labelComponent prop. Read about it in detail

note

To enable tooltips on VictoryArea, it is necessary to use VictoryVoronoiContainer

Live View
Loading...
Live Editor

style

type: VictoryStyleInterfacedefault: (provided by theme)

Defines the style of the component using VictoryStyleInterface.

note

Since VictoryArea renders a single element to represent an entire dataset, it is not possible to use functional styles to change the style of the line as a function of an individual datum. Instead, try using gradient fills for styling continuous data.

Live View
Loading...
Live Editor