| id | Bullet chart | |||
|---|---|---|---|---|
| section | components | |||
| subsection | charts | |||
| propComponents |
|
|||
| hideDarkMode | true |
import { createRef } from 'react'; import { ChartAxis, ChartBullet, ChartContainer, ChartThemeColor } from '@patternfly/react-charts/victory'; import { getResizeObserver } from '@patternfly/react-core';
Note: PatternFly React charts live in its own package at @patternfly/react-charts!
The examples below are based on the Victory chart library, along with additional functionality, custom components, and theming for PatternFly. This provides a collection of React based components you can use to build PatternFly patterns with consistent markup, styling, and behavior.
This demonstrates a responsive legend which wraps when items are wider than its container.
This is a green bullet chart with error measure and custom axis ticks with 3 legend items per row.
This is a yellow bullet chart with primary measure greater than max range.
This bullet chart with negative primary measure is for measures considered to be bad when they are low.
This reversed bullet chart with right aligned legend is for measures considered to be good when they are low.
This bullet chart with negative and positive primary measures has 4 legend items per row.
- See Victory's FAQ
ChartLegendmay be used as a standalone component, instead of usinglegendData
Currently, the generated documentation below is not able to resolve type definitions from Victory imports. For the components used in the examples above, Victory pass-thru props are also documented here:
- For
ChartAxisprops, see VictoryAxis - For
ChartBulletprops, see VictoryBar - For
ChartContainerprops, see VictoryContainer