VictoryBoxPlot
info
For examples of VictoryBoxPlot
in action, visit the Box Plot examples.
Inherited Props
VictoryDatableProps
- dataoverridden
VictoryCommonProps
Component Props
boxWidth
type: number
The boxWidth
prop specifies how wide each box should be. If the whiskerWidth
prop is not set, this prop will also determine the width of the whisker crosshair.
Live View
Loading...
Live Editor
<VictoryChart domainPadding={10} theme={VictoryTheme.clean} > <VictoryBoxPlot boxWidth={10} whiskerWidth={5} data={[ { x: 1, y: [1, 2, 3, 5] }, { x: 2, y: [3, 2, 8, 10] }, { x: 3, y: [2, 8, 6, 5] }, { x: 4, y: [1, 3, 2, 9] }, ]} /> </VictoryChart>
data
type: any[]
The data
prop for VictoryBoxPlot
may be given in a a variety of formats:
- As an array of standard data objects with values specified for
x
andy
When given in this format, repeated values forx
will be used for calculating summary statistics
data={[
{ x: 1, y: 2 },
{ x: 1, y: 3 },
{ x: 1, y: 5 },
{ x: 2, y: 1 },
{ x: 2, y: 4 },
{ x: 2, y: 5 },
...
]}
- As an array of data objects where
y
is given as an array of values When given in this format, array values are used for calculating summary statistics.
data={[
{ x: 1, y: [1, 2, 3, 5] },
{ x: 2, y: [3, 2, 8, 10] },
{ x: 3, y: [2, 8, 6, 5] },
{ x: 4, y: [1, 3, 2, 9] }
]}
- As an array of data objects with pre-calculated summary statistics(
min
,median
,max
,q1
,q3
) When given in this format,VictoryBoxPlot
will not perform statistical analysis. Pre-calculating summary statistics for large datasets will improve performance.
data={[
{ x: 1, min: 2, median: 5, max: 10, q1: 3, q3: 7 },
{ x: 2, min: 1, median: 4, max: 9, q1: 3, q3: 6 },
{ x: 3, min: 1, median: 6, max: 12, q1: 4, q3: 10 },
}]
Use the [x
][], [y
][], [min
][], [max
][], [median
][], [q1
][], and [q3
][] data accessor props to specify custom data formats. Refer to the [Data Accessors Guide][] for more detail.