| id | Threshold chart | |||||
|---|---|---|---|---|---|---|
| section | charts | |||||
| propComponents |
|
|||||
| hideDarkMode | true |
import { createRef } from 'react'; import { Chart, ChartArea, ChartAxis, ChartGroup, ChartLegend, ChartThreshold, ChartThemeColor, ChartVoronoiContainer } from '@patternfly/react-charts/victory'; import { getResizeObserver } from '@patternfly/react-core'; import chart_color_blue_300 from '@patternfly/react-tokens/dist/esm/chart_color_blue_300'; import chart_color_orange_300 from '@patternfly/react-tokens/dist/esm/chart_color_orange_300'; import { useEffect, useRef, useState } from 'react';
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.
- See Victory's FAQ
- For single data points or zero values, you may want to set the
domainprop 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
Chartprops, see VictoryChart - For
ChartAreaprops, see VictoryArea - For
ChartAxisprops, see VictoryAxis - For
ChartGroupprops, see VictoryGroup - For
ChartLegendprops, see VictoryLegend - For
ChartThresholdprops, see VictoryLine - For
ChartVoronoiContainerprops, see VictoryVoronoiContainer