diff --git a/packages/react-charts/src/components/ChartArea/examples/ChartArea.md b/packages/react-charts/src/components/ChartArea/examples/ChartArea.md
index cc14604a2bf..0de79c1c0ea 100644
--- a/packages/react-charts/src/components/ChartArea/examples/ChartArea.md
+++ b/packages/react-charts/src/components/ChartArea/examples/ChartArea.md
@@ -13,7 +13,7 @@ propComponents: [
hideDarkMode: true
---
-import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThreshold, ChartThemeColor, ChartThemeVariant, ChartVoronoiContainer, createContainer } from '@patternfly/react-charts';
+import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThreshold, ChartThemeColor, ChartLegendTooltip, ChartThemeVariant, ChartVoronoiContainer, createContainer } from '@patternfly/react-charts';
import '@patternfly/patternfly/patternfly-charts.css';
## Introduction
@@ -90,13 +90,14 @@ BasicRightAlignedLegend = (
```js title=Cyan-with-bottom-aligned-legend-and-axis-label
import React from 'react';
-import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThemeColor, ChartVoronoiContainer, createContainer } from '@patternfly/react-charts';
+import { Chart, ChartArea, ChartAxis, ChartGroup, ChartThemeColor, ChartLegendTooltip, ChartVoronoiContainer, createContainer } from '@patternfly/react-charts';
// import '@patternfly/patternfly/patternfly-charts.css'; // Required for mix-blend-mode CSS property
class BottomAlignedLegend extends React.Component {
render() {
// Note: Container order is important
const CursorVoronoiContainer = createContainer("cursor", "voronoi");
+ const legendData = [{ name: 'Cats' }, { name: 'Dogs', symbol: { type: 'dash' } }, { name: 'Birds' }];
return (
@@ -107,15 +108,15 @@ class BottomAlignedLegend extends React.Component {
ariaTitle="Area chart example"
containerComponent={
`${datum.name}: ${datum.y}`}
+ labels={({ datum }) => `${datum.y}`}
+ labelComponent={ datum.x}/>}
mouseFollowTooltips
voronoiDimension="x"
voronoiPadding={50}
/>
}
- legendData={[{ name: 'Cats' }, { name: 'Dogs' }, { name: 'Birds' }]}
+ legendData={legendData}
legendPosition="bottom"
height={250}
padding={{
diff --git a/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx b/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx
new file mode 100644
index 00000000000..ad045717f9b
--- /dev/null
+++ b/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.test.tsx
@@ -0,0 +1,37 @@
+import * as React from 'react';
+import { shallow } from 'enzyme';
+import { ChartArea } from '../ChartArea';
+import { ChartGroup } from '../ChartGroup';
+import { ChartCursorContainer } from './ChartCursorContainer';
+
+Object.values([true, false]).forEach(() => {
+ test('ChartVoronoiContainer', () => {
+ const view = shallow();
+ expect(view).toMatchSnapshot();
+ });
+});
+
+test('renders container via ChartGroup', () => {
+ const view = shallow(
+ } height={200} width={200}>
+
+
+
+ );
+ expect(view).toMatchSnapshot();
+});
diff --git a/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.tsx b/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.tsx
new file mode 100644
index 00000000000..27cb128253b
--- /dev/null
+++ b/packages/react-charts/src/components/ChartCursorContainer/ChartCursorContainer.tsx
@@ -0,0 +1,217 @@
+import * as React from 'react';
+import hoistNonReactStatics from 'hoist-non-react-statics';
+import { CoordinatesPropType, OriginType } from 'victory-core';
+import { VictoryCursorContainer, VictoryCursorContainerProps } from 'victory-cursor-container';
+import { ChartLabel } from '../ChartLabel';
+import { ChartThemeDefinition } from '../ChartTheme';
+import { ChartCursorTooltip } from '../ChartTooltip';
+import { getClassName, getTheme } from '../ChartUtils';
+
+/**
+ * See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/victory/index.d.ts
+ */
+export interface ChartCursorContainerProps extends VictoryCursorContainerProps {
+ /**
+ * he children prop specifies the child or children that will be rendered within the container. It will be set by
+ * whatever Victory component is rendering the container.
+ *
+ * **This prop should not be set manually.**
+ */
+ children?: React.ReactElement | React.ReactElement[];
+ /**
+ * The className prop specifies a className that will be applied to the outer-most div rendered by the container
+ */
+ className?: string;
+ /**
+ * The containerId prop may be used to set a deterministic id for the container. When a containerId is not manually
+ * set, a unique id will be generated. It is usually necessary to set deterministic ids for automated testing.
+ */
+ containerId?: number | string;
+ /**
+ * The cursorComponent prop takes a component instance which will be used to render a cursor element. The new element
+ * created will be supplied with x1, y1, x2 and y2 positioning props.
+ */
+ cursorComponent?: React.ReactElement;
+ /**
+ * When the cursorDimension prop is set, the cursor will be a line to inspect the given dimension (either "x" or "y").
+ * When this prop is not specified, the cursor will be a 2-dimensional crosshair. For example, if you would like to
+ * inspect the time of time-series data, set dimension={"x"}; the cursor will then be a vertical line that will
+ * inspect the time value of the current mouse position.
+ */
+ cursorDimension?: 'x' | 'y';
+ /**
+ * The cursorLabel prop defines the label that will appear next to the cursor. A label will only appear if cursorLabel
+ * is set. This prop should be given as a function of a point (an Object with x and y properties).
+ *
+ * example: cursorLabel={(point) => point.x}
+ */
+ cursorLabel?: (point: CoordinatesPropType) => any | void;
+ /**
+ * The cursorLabelComponent prop takes a component instance which will be used to render a label for the cursor. The
+ * new element created from the passed cursorLabelComponent will be supplied with the following props: x, y, active,
+ * text. If cursorLabelComponent is omitted, a new ChartLabel will be created with the props described above.
+ */
+ cursorLabelComponent?: React.ReactElement;
+ /**
+ * The cursorLabelOffset prop determines the pixel offset of the cursor label from the cursor point. This prop should
+ * be an Object with x and y properties, or a number to be used for both dimensions.
+ */
+ cursorLabelOffset?: number | CoordinatesPropType;
+ /**
+ * Whenever the mouse is not over the chart, the cursor will not be displayed. If instead you would like to keep it
+ * displayed, use the defaultCursorValue prop to set the default value. The prop should be a point (an Object with x
+ * and y properties) for 2-dimensional cursors, or a number for 1-dimensional cursors.
+ *
+ * examples: defaultCursorValue={{x: 1, y: 1}}, defaultCursorValue={0}
+ */
+ defaultCursorValue?: number | CoordinatesPropType;
+ /**
+ * The desc prop specifies the description of the chart/SVG to assist with
+ * accessibility for screen readers. The more info about the chart provided in
+ * the description, the more usable it will be for people using screen readers.
+ * This prop defaults to an empty string.
+ *
+ * @example "Golden retreivers make up 30%, Labs make up 25%, and other dog breeds are
+ * not represented above 5% each."
+ */
+ desc?: string;
+ /**
+ * When the disable prop is set to true, ChartCursorContainer events will not fire.
+ */
+ disable?: boolean;
+ /**
+ * The events prop attaches arbitrary event handlers to the container component.
+ * Event handlers passed from other Victory components are called with their
+ * corresponding events as well as scale, style, width, height, and data when
+ * applicable. Use the invert method to convert event coordinate information to
+ * data. `scale.x.invert(evt.offsetX)`.
+ *
+ * @example {{ onClick: (evt) => alert(`x: ${evt.clientX}, y: ${evt.clientY}`)}}
+ */
+ events?: React.DOMAttributes;
+ /**
+ * The height props specifies the height the svg viewBox of the container.
+ * This value should be given as a number of pixels. If no height prop
+ * is given, the height prop from the child component passed will be used.
+ */
+ height?: number;
+ /**
+ * The name prop is used to reference a component instance when defining shared events.
+ */
+ name?: string;
+ /**
+ * If provided, the onCursorChange function will be called every time the cursor value changes. onCursorChange is
+ * called with value (the updated cursor value) and props (the props used by ChartCursorContainer). A common use for
+ * onCursorChange is to save the cursor value to state and use it in another part of the view.
+ *
+ * example: onCursorChange={(value, props) => this.setState({cursorValue: value})}
+ */
+ onCursorChange?: (value: CoordinatesPropType, props: VictoryCursorContainerProps) => void;
+ /**
+ * Victory components will pass an origin prop is to define the center point in svg coordinates for polar charts.
+ *
+ * **This prop should not be set manually.**
+ */
+ origin?: OriginType;
+ /**
+ * Victory components can pass a boolean polar prop to specify whether a label is part of a polar chart.
+ *
+ * **This prop should not be set manually.**
+ */
+ polar?: boolean;
+ /**
+ * The portalComponent prop takes a component instance which will be used as a container for children that should
+ * render inside a top-level container so that they will always appear above other elements. ChartTooltip renders
+ * inside a portal so that tooltips always render above data. VictoryPortal is used to define elements that should
+ * render in the portal container. This prop defaults to Portal, and should only be overridden when changing rendered
+ * elements from SVG to another type of element e.g., react-native-svg elements.
+ */
+ portalComponent?: React.ReactElement;
+ /**
+ * The portalZIndex prop determines the z-index of the div enclosing the portal component. If a portalZIndex prop is
+ * not set, the z-index of the enclosing div will be set to 99.
+ */
+ portalZIndex?: number;
+ /**
+ * The responsive prop specifies whether the rendered container should be a responsive container
+ * with a viewBox attribute, or a static container with absolute width and height.
+ *
+ * @default true
+ */
+ responsive?: boolean;
+ /**
+ * The style prop specifies styles for your ChartContainer. Any valid inline style properties
+ * will be applied. Height and width should be specified via the height
+ * and width props, as they are used to calculate the alignment of
+ * components within the container. Styles from the child component will
+ * also be passed, if any exist.
+ *
+ * @example {border: 1px solid red}
+ */
+ style?: React.CSSProperties;
+ /**
+ * The tabIndex prop specifies the description of the chart/SVG to assist with accessibility.
+ */
+ tabIndex?: number;
+ /**
+ * The theme prop specifies a theme to use for determining styles and layout properties for a component. Any styles or
+ * props defined in theme may be overwritten by props specified on the component instance.
+ */
+ theme?: ChartThemeDefinition;
+ /**
+ * Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.
+ *
+ * Note: Not compatible with theme prop
+ *
+ * @example themeColor={ChartThemeColor.blue}
+ */
+ themeColor?: string;
+ /**
+ * Specifies the theme variant. Valid values are 'dark' or 'light'
+ *
+ * Note: Not compatible with theme prop
+ *
+ * @example themeVariant={ChartThemeVariant.light}
+ */
+ themeVariant?: string;
+ /**
+ * The width props specifies the width of the svg viewBox of the container
+ * This value should be given as a number of pixels. If no width prop
+ * is given, the width prop from the child component passed will be used.
+ */
+ width?: number;
+}
+
+export const ChartCursorContainer: React.FunctionComponent = ({
+ className,
+ themeColor,
+ themeVariant,
+
+ // destructure last
+ theme = getTheme(themeColor, themeVariant),
+ cursorLabelComponent = , // Note that Victory provides its own label component here
+ ...rest
+}: ChartCursorContainerProps) => {
+ const chartClassName = getClassName({ className });
+ const chartCursorLabelComponent = React.cloneElement(cursorLabelComponent, {
+ theme,
+ ...cursorLabelComponent.props
+ });
+
+ // Note: theme is required by voronoiContainerMixin
+ return (
+ // Note: className is valid, but Victory is missing a type
+ // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
+ // @ts-ignore
+
+ );
+};
+ChartCursorContainer.defaultProps = (VictoryCursorContainer as any).defaultProps;
+
+// Note: VictoryCursorContainer.defaultEvents & VictoryContainer.role must be hoisted
+hoistNonReactStatics(ChartCursorContainer, VictoryCursorContainer);
diff --git a/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap b/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap
new file mode 100644
index 00000000000..140c70dba31
--- /dev/null
+++ b/packages/react-charts/src/components/ChartCursorContainer/__snapshots__/ChartCursorContainer.test.tsx.snap
@@ -0,0 +1,2856 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`ChartVoronoiContainer 1`] = `
+}
+ role="presentation"
+ shapeRendering="auto"
+ />
+ }
+ cursorLabelComponent={
+ }
+ theme={
+ Object {
+ "area": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "fillOpacity": 0.3,
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "axis": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "axis": Object {
+ "fill": "transparent",
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ "axisLabel": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 40,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ "grid": Object {
+ "fill": "none",
+ "pointerEvents": "painted",
+ "stroke": "none",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ },
+ "tickLabels": Object {
+ "fill": "#4f5255",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "ticks": Object {
+ "fill": "transparent",
+ "size": 5,
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "bar": Object {
+ "barWidth": 10,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "padding": 8,
+ "stroke": "none",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "boxplot": Object {
+ "boxWidth": 20,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "max": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "maxLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "median": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "medianLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "min": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "minLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q1": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q1Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q3": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q3Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "candlestick": Object {
+ "candleColors": Object {
+ "negative": "#151515",
+ "positive": "#fff",
+ },
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "chart": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "errorbar": Object {
+ "borderWidth": 8,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#151515",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "group": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "legend": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "gutter": 20,
+ "orientation": "horizontal",
+ "style": Object {
+ "data": Object {
+ "type": "square",
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "title": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 2,
+ "stroke": "transparent",
+ },
+ },
+ "titleOrientation": "top",
+ },
+ "line": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#06c",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "pie": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 230,
+ "padding": 20,
+ "style": Object {
+ "data": Object {
+ "padding": 8,
+ "stroke": "transparent",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "stroke": "transparent",
+ },
+ },
+ "width": 230,
+ },
+ "scatter": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#151515",
+ "opacity": 1,
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "stack": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "tooltip": Object {
+ "cornerRadius": 0,
+ "flyoutStyle": Object {
+ "cornerRadius": 0,
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 0,
+ },
+ "pointerLength": 10,
+ "pointerWidth": 20,
+ "style": Object {
+ "fill": "#f0f0f0",
+ "padding": 16,
+ "pointerEvents": "none",
+ },
+ },
+ "voronoi": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "flyout": Object {
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fill": "#f0f0f0",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "pointerEvents": "none",
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ }
+ }
+ tspanComponent={}
+ />
+ }
+ cursorLabelOffset={
+ Object {
+ "x": 5,
+ "y": -10,
+ }
+ }
+ portalComponent={}
+ portalZIndex={99}
+ responsive={true}
+ theme={
+ Object {
+ "area": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "fillOpacity": 0.3,
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "axis": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "axis": Object {
+ "fill": "transparent",
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ "axisLabel": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 40,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ "grid": Object {
+ "fill": "none",
+ "pointerEvents": "painted",
+ "stroke": "none",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ },
+ "tickLabels": Object {
+ "fill": "#4f5255",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "ticks": Object {
+ "fill": "transparent",
+ "size": 5,
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "bar": Object {
+ "barWidth": 10,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "padding": 8,
+ "stroke": "none",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "boxplot": Object {
+ "boxWidth": 20,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "max": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "maxLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "median": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "medianLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "min": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "minLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q1": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q1Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q3": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q3Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "candlestick": Object {
+ "candleColors": Object {
+ "negative": "#151515",
+ "positive": "#fff",
+ },
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "chart": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "errorbar": Object {
+ "borderWidth": 8,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#151515",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "group": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "legend": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "gutter": 20,
+ "orientation": "horizontal",
+ "style": Object {
+ "data": Object {
+ "type": "square",
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "title": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 2,
+ "stroke": "transparent",
+ },
+ },
+ "titleOrientation": "top",
+ },
+ "line": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#06c",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "pie": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 230,
+ "padding": 20,
+ "style": Object {
+ "data": Object {
+ "padding": 8,
+ "stroke": "transparent",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "stroke": "transparent",
+ },
+ },
+ "width": 230,
+ },
+ "scatter": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#151515",
+ "opacity": 1,
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "stack": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "tooltip": Object {
+ "cornerRadius": 0,
+ "flyoutStyle": Object {
+ "cornerRadius": 0,
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 0,
+ },
+ "pointerLength": 10,
+ "pointerWidth": 20,
+ "style": Object {
+ "fill": "#f0f0f0",
+ "padding": 16,
+ "pointerEvents": "none",
+ },
+ },
+ "voronoi": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "flyout": Object {
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fill": "#f0f0f0",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "pointerEvents": "none",
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ }
+ }
+/>
+`;
+
+exports[`ChartVoronoiContainer 2`] = `
+}
+ role="presentation"
+ shapeRendering="auto"
+ />
+ }
+ cursorLabelComponent={
+ }
+ theme={
+ Object {
+ "area": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "fillOpacity": 0.3,
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "axis": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "axis": Object {
+ "fill": "transparent",
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ "axisLabel": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 40,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ "grid": Object {
+ "fill": "none",
+ "pointerEvents": "painted",
+ "stroke": "none",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ },
+ "tickLabels": Object {
+ "fill": "#4f5255",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "ticks": Object {
+ "fill": "transparent",
+ "size": 5,
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "bar": Object {
+ "barWidth": 10,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "padding": 8,
+ "stroke": "none",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "boxplot": Object {
+ "boxWidth": 20,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "max": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "maxLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "median": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "medianLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "min": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "minLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q1": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q1Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q3": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q3Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "candlestick": Object {
+ "candleColors": Object {
+ "negative": "#151515",
+ "positive": "#fff",
+ },
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "chart": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "errorbar": Object {
+ "borderWidth": 8,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#151515",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "group": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "legend": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "gutter": 20,
+ "orientation": "horizontal",
+ "style": Object {
+ "data": Object {
+ "type": "square",
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "title": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 2,
+ "stroke": "transparent",
+ },
+ },
+ "titleOrientation": "top",
+ },
+ "line": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#06c",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "pie": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 230,
+ "padding": 20,
+ "style": Object {
+ "data": Object {
+ "padding": 8,
+ "stroke": "transparent",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "stroke": "transparent",
+ },
+ },
+ "width": 230,
+ },
+ "scatter": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#151515",
+ "opacity": 1,
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "stack": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "tooltip": Object {
+ "cornerRadius": 0,
+ "flyoutStyle": Object {
+ "cornerRadius": 0,
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 0,
+ },
+ "pointerLength": 10,
+ "pointerWidth": 20,
+ "style": Object {
+ "fill": "#f0f0f0",
+ "padding": 16,
+ "pointerEvents": "none",
+ },
+ },
+ "voronoi": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "flyout": Object {
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fill": "#f0f0f0",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "pointerEvents": "none",
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ }
+ }
+ tspanComponent={}
+ />
+ }
+ cursorLabelOffset={
+ Object {
+ "x": 5,
+ "y": -10,
+ }
+ }
+ portalComponent={}
+ portalZIndex={99}
+ responsive={true}
+ theme={
+ Object {
+ "area": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "fillOpacity": 0.3,
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "axis": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "axis": Object {
+ "fill": "transparent",
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ "axisLabel": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 40,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ "grid": Object {
+ "fill": "none",
+ "pointerEvents": "painted",
+ "stroke": "none",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ },
+ "tickLabels": Object {
+ "fill": "#4f5255",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "ticks": Object {
+ "fill": "transparent",
+ "size": 5,
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "bar": Object {
+ "barWidth": 10,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "padding": 8,
+ "stroke": "none",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "boxplot": Object {
+ "boxWidth": 20,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "max": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "maxLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "median": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "medianLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "min": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "minLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q1": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q1Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q3": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q3Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "candlestick": Object {
+ "candleColors": Object {
+ "negative": "#151515",
+ "positive": "#fff",
+ },
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "chart": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "errorbar": Object {
+ "borderWidth": 8,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#151515",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "group": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "legend": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "gutter": 20,
+ "orientation": "horizontal",
+ "style": Object {
+ "data": Object {
+ "type": "square",
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "title": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 2,
+ "stroke": "transparent",
+ },
+ },
+ "titleOrientation": "top",
+ },
+ "line": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#06c",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "pie": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 230,
+ "padding": 20,
+ "style": Object {
+ "data": Object {
+ "padding": 8,
+ "stroke": "transparent",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "stroke": "transparent",
+ },
+ },
+ "width": 230,
+ },
+ "scatter": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#151515",
+ "opacity": 1,
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "stack": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "tooltip": Object {
+ "cornerRadius": 0,
+ "flyoutStyle": Object {
+ "cornerRadius": 0,
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 0,
+ },
+ "pointerLength": 10,
+ "pointerWidth": 20,
+ "style": Object {
+ "fill": "#f0f0f0",
+ "padding": 16,
+ "pointerEvents": "none",
+ },
+ },
+ "voronoi": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "flyout": Object {
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fill": "#f0f0f0",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "pointerEvents": "none",
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ }
+ }
+/>
+`;
+
+exports[`renders container via ChartGroup 1`] = `
+}
+ role="presentation"
+ shapeRendering="auto"
+ />
+ }
+ cursorLabelComponent={
+ }
+ tspanComponent={}
+ />
+ }
+ cursorLabelOffset={
+ Object {
+ "x": 5,
+ "y": -10,
+ }
+ }
+ portalComponent={}
+ portalZIndex={99}
+ responsive={true}
+ theme={
+ Object {
+ "area": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "fillOpacity": 0.3,
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "axis": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "axis": Object {
+ "fill": "transparent",
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ "axisLabel": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 40,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ "grid": Object {
+ "fill": "none",
+ "pointerEvents": "painted",
+ "stroke": "none",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ },
+ "tickLabels": Object {
+ "fill": "#4f5255",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "ticks": Object {
+ "fill": "transparent",
+ "size": 5,
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "bar": Object {
+ "barWidth": 10,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "padding": 8,
+ "stroke": "none",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "boxplot": Object {
+ "boxWidth": 20,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "max": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "maxLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "median": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "medianLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "min": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "minLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q1": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q1Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q3": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q3Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "candlestick": Object {
+ "candleColors": Object {
+ "negative": "#151515",
+ "positive": "#fff",
+ },
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "chart": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "errorbar": Object {
+ "borderWidth": 8,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#151515",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "group": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "legend": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "gutter": 20,
+ "orientation": "horizontal",
+ "style": Object {
+ "data": Object {
+ "type": "square",
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "title": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 2,
+ "stroke": "transparent",
+ },
+ },
+ "titleOrientation": "top",
+ },
+ "line": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#06c",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "pie": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 230,
+ "padding": 20,
+ "style": Object {
+ "data": Object {
+ "padding": 8,
+ "stroke": "transparent",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "stroke": "transparent",
+ },
+ },
+ "width": 230,
+ },
+ "scatter": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#151515",
+ "opacity": 1,
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "stack": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "tooltip": Object {
+ "cornerRadius": 0,
+ "flyoutStyle": Object {
+ "cornerRadius": 0,
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 0,
+ },
+ "pointerLength": 10,
+ "pointerWidth": 20,
+ "style": Object {
+ "fill": "#f0f0f0",
+ "padding": 16,
+ "pointerEvents": "none",
+ },
+ },
+ "voronoi": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "flyout": Object {
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fill": "#f0f0f0",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "pointerEvents": "none",
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ }
+ }
+ />
+ }
+ groupComponent={}
+ height={200}
+ samples={50}
+ sortOrder="ascending"
+ standalone={true}
+ theme={
+ Object {
+ "area": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "fillOpacity": 0.3,
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "axis": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "axis": Object {
+ "fill": "transparent",
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ "axisLabel": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 40,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ "grid": Object {
+ "fill": "none",
+ "pointerEvents": "painted",
+ "stroke": "none",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ },
+ "tickLabels": Object {
+ "fill": "#4f5255",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "ticks": Object {
+ "fill": "transparent",
+ "size": 5,
+ "stroke": "#d2d2d2",
+ "strokeLinecap": "round",
+ "strokeLinejoin": "round",
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "bar": Object {
+ "barWidth": 10,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#06c",
+ "padding": 8,
+ "stroke": "none",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "boxplot": Object {
+ "boxWidth": 20,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "max": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "maxLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "median": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "medianLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "min": Object {
+ "padding": 8,
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "minLabels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q1": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q1Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "q3": Object {
+ "fill": "#8a8d90",
+ "padding": 8,
+ },
+ "q3Labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ },
+ "width": 450,
+ },
+ "candlestick": Object {
+ "candleColors": Object {
+ "negative": "#151515",
+ "positive": "#fff",
+ },
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "chart": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "errorbar": Object {
+ "borderWidth": 8,
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#151515",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "group": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "width": 450,
+ },
+ "legend": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "gutter": 20,
+ "orientation": "horizontal",
+ "style": Object {
+ "data": Object {
+ "type": "square",
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ },
+ "title": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 2,
+ "stroke": "transparent",
+ },
+ },
+ "titleOrientation": "top",
+ },
+ "line": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "opacity": 1,
+ "stroke": "#06c",
+ "strokeWidth": 2,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "pie": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 230,
+ "padding": 20,
+ "style": Object {
+ "data": Object {
+ "padding": 8,
+ "stroke": "transparent",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "stroke": "transparent",
+ },
+ },
+ "width": 230,
+ },
+ "scatter": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "#151515",
+ "opacity": 1,
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "labels": Object {
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 10,
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ "stack": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "strokeWidth": 1,
+ },
+ },
+ "width": 450,
+ },
+ "tooltip": Object {
+ "cornerRadius": 0,
+ "flyoutStyle": Object {
+ "cornerRadius": 0,
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 0,
+ },
+ "pointerLength": 10,
+ "pointerWidth": 20,
+ "style": Object {
+ "fill": "#f0f0f0",
+ "padding": 16,
+ "pointerEvents": "none",
+ },
+ },
+ "voronoi": Object {
+ "colorScale": Array [
+ "#06c",
+ "#8bc1f7",
+ "#002f5d",
+ "#519de9",
+ "#004b95",
+ ],
+ "height": 300,
+ "padding": 50,
+ "style": Object {
+ "data": Object {
+ "fill": "transparent",
+ "stroke": "transparent",
+ "strokeWidth": 0,
+ },
+ "flyout": Object {
+ "fill": "#151515",
+ "pointerEvents": "none",
+ "stroke": "#151515",
+ "strokeWidth": 1,
+ },
+ "labels": Object {
+ "fill": "#f0f0f0",
+ "fontFamily": "var(--pf-chart-global--FontFamily)",
+ "fontSize": 14,
+ "letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "padding": 8,
+ "pointerEvents": "none",
+ "stroke": "transparent",
+ "textAnchor": "middle",
+ },
+ },
+ "width": 450,
+ },
+ }
+ }
+ width={200}
+>
+
+
+
+`;
diff --git a/packages/react-charts/src/components/ChartCursorContainer/index.ts b/packages/react-charts/src/components/ChartCursorContainer/index.ts
new file mode 100644
index 00000000000..4771ace315f
--- /dev/null
+++ b/packages/react-charts/src/components/ChartCursorContainer/index.ts
@@ -0,0 +1 @@
+export * from './ChartCursorContainer';
diff --git a/packages/react-charts/src/components/ChartLabel/ChartLabel.tsx b/packages/react-charts/src/components/ChartLabel/ChartLabel.tsx
index 81b04f12105..ad47d35e49f 100644
--- a/packages/react-charts/src/components/ChartLabel/ChartLabel.tsx
+++ b/packages/react-charts/src/components/ChartLabel/ChartLabel.tsx
@@ -146,6 +146,7 @@ export interface ChartLabelProps extends VictoryLabelProps {
text?: string[] | StringOrNumberOrCallback;
/**
* The textAnchor prop defines how the text is horizontally positioned relative to the given `x` and `y` coordinates.
+ * Options are "start", "middle" and "end". Note that this overrides the style prop.
*/
textAnchor?: TextAnchorType | (() => TextAnchorType);
/**
@@ -154,7 +155,8 @@ export interface ChartLabelProps extends VictoryLabelProps {
*/
transform?: string | {} | (() => string | {});
/**
- * The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y` coordinates
+ * The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y`
+ * coordinates. Options are "start", "middle" and "end".
*/
verticalAnchor?: VerticalAnchorType | (() => VerticalAnchorType);
/**
@@ -174,15 +176,26 @@ export interface ChartLabelProps extends VictoryLabelProps {
y?: number;
}
-export const ChartLabel: React.FunctionComponent = ({ style, ...rest }: ChartLabelProps) => {
+export const ChartLabel: React.FunctionComponent = ({
+ style,
+ textAnchor,
+ ...rest
+}: ChartLabelProps) => {
const applyDefaultStyle = (customStyle: React.CSSProperties) =>
- defaults(customStyle, {
- fontFamily: ChartCommonStyles.label.fontFamily,
- fontSize: ChartCommonStyles.label.fontSize,
- letterSpacing: ChartCommonStyles.label.letterSpacing
- });
+ defaults(
+ {
+ ...customStyle,
+ textAnchor // textAnchor prop must override given theme styles
+ },
+ {
+ fontFamily: ChartCommonStyles.label.fontFamily,
+ fontSize: ChartCommonStyles.label.fontSize,
+ letterSpacing: ChartCommonStyles.label.letterSpacing
+ }
+ );
const newStyle = Array.isArray(style) ? style.map(applyDefaultStyle) : applyDefaultStyle(style);
- return ;
+
+ return ;
};
// Note: VictoryLabel.role must be hoisted
diff --git a/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap b/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap
index b324ec87369..54761a141c5 100644
--- a/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLabel/__snapshots__/ChartLabel.test.tsx.snap
@@ -10,6 +10,7 @@ exports[`ChartLabel 1`] = `
"fontFamily": "var(--pf-chart-global--FontFamily)",
"fontSize": 14,
"letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "textAnchor": undefined,
}
}
textComponent={}
@@ -27,6 +28,7 @@ exports[`ChartLabel 2`] = `
"fontFamily": "var(--pf-chart-global--FontFamily)",
"fontSize": 14,
"letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "textAnchor": undefined,
}
}
textComponent={}
@@ -44,6 +46,7 @@ exports[`renders component text 1`] = `
"fontFamily": "var(--pf-chart-global--FontFamily)",
"fontSize": 14,
"letterSpacing": "var(--pf-chart-global--letter-spacing)",
+ "textAnchor": undefined,
}
}
text="This is a test"
diff --git a/packages/react-charts/src/components/ChartLegend/ChartLegend.tsx b/packages/react-charts/src/components/ChartLegend/ChartLegend.tsx
index b6cb2431d54..251637c414e 100644
--- a/packages/react-charts/src/components/ChartLegend/ChartLegend.tsx
+++ b/packages/react-charts/src/components/ChartLegend/ChartLegend.tsx
@@ -300,9 +300,11 @@ export interface ChartLegendProps extends VictoryLegendProps {
export const ChartLegend: React.FunctionComponent = ({
containerComponent = ,
dataComponent = ,
+ labelComponent = ,
responsive = true,
themeColor,
themeVariant,
+ titleComponent = ,
// destructure last
theme = getTheme(themeColor, themeVariant),
@@ -316,7 +318,16 @@ export const ChartLegend: React.FunctionComponent = ({
});
// Note: containerComponent is required for theme
- return ;
+ return (
+
+ );
};
// Note: VictoryLegend.role must be hoisted, but getBaseProps causes error with ChartVoronoiContainer
diff --git a/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap b/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap
index 8e53b4e95c1..067613b580b 100644
--- a/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap
+++ b/packages/react-charts/src/components/ChartLegend/__snapshots__/ChartLegend.test.tsx.snap
@@ -475,15 +475,7 @@ exports[`ChartLegend 1`] = `
}
dataComponent={}
groupComponent={}
- labelComponent={
- }
- tspanComponent={}
- />
- }
+ labelComponent={}
standalone={true}
theme={
Object {
@@ -934,15 +926,7 @@ exports[`ChartLegend 1`] = `
},
}
}
- titleComponent={
- }
- tspanComponent={}
- />
- }
+ titleComponent={}
/>
`;
@@ -1421,15 +1405,7 @@ exports[`ChartLegend 2`] = `
}
dataComponent={}
groupComponent={}
- labelComponent={
- }
- tspanComponent={}
- />
- }
+ labelComponent={}
standalone={true}
theme={
Object {
@@ -1880,15 +1856,7 @@ exports[`ChartLegend 2`] = `
},
}
}
- titleComponent={
- }
- tspanComponent={}
- />
- }
+ titleComponent={}
/>
`;
@@ -2368,15 +2336,7 @@ exports[`renders component data 1`] = `
dataComponent={}
groupComponent={}
height={50}
- labelComponent={
- }
- tspanComponent={}
- />
- }
+ labelComponent={}
standalone={true}
theme={
Object {
@@ -2828,15 +2788,7 @@ exports[`renders component data 1`] = `
}
}
title="Average number of pets"
- titleComponent={
- }
- tspanComponent={}
- />
- }
+ titleComponent={}
width={200}
/>
`;
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx
new file mode 100644
index 00000000000..23c76e18d35
--- /dev/null
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.test.tsx
@@ -0,0 +1,97 @@
+import * as React from 'react';
+import { shallow } from 'enzyme';
+import { Chart } from '../Chart';
+import { ChartAxis } from '../ChartAxis';
+import { ChartGroup } from '../ChartGroup';
+import { ChartLine } from '../ChartLine';
+import { ChartThemeColor } from '../ChartTheme';
+import { createContainer } from '../ChartUtils';
+import { ChartLegendTooltip } from './ChartLegendTooltip';
+
+Object.values([true, false]).forEach(() => {
+ test('ChartLegendTooltip', () => {
+ const view = shallow();
+ expect(view).toMatchSnapshot();
+ });
+});
+
+test('allows tooltip via container component', () => {
+ const CursorVoronoiContainer = createContainer('cursor', 'voronoi');
+ const legendData = [
+ { name: 'Cats' },
+ { name: 'Dogs', symbol: { type: 'dash' } },
+ { name: 'Birds' },
+ { name: 'Mice' }
+ ];
+ const view = shallow(
+ `${datum.y !== null ? datum.y : 'no data'}`}
+ labelComponent={ datum.x} />}
+ mouseFollowTooltips
+ voronoiDimension="x"
+ voronoiPadding={50}
+ />
+ }
+ legendData={legendData}
+ legendPosition="bottom"
+ height={275}
+ maxDomain={{ y: 10 }}
+ minDomain={{ y: 0 }}
+ padding={{
+ bottom: 75, // Adjusted to accommodate legend
+ left: 50,
+ right: 50,
+ top: 50
+ }}
+ themeColor={ChartThemeColor.green}
+ width={450}
+ >
+
+
+
+
+
+
+
+
+
+ );
+ expect(view).toMatchSnapshot();
+});
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.tsx
new file mode 100644
index 00000000000..950b9a5c085
--- /dev/null
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltip.tsx
@@ -0,0 +1,313 @@
+import * as React from 'react';
+import hoistNonReactStatics from 'hoist-non-react-statics';
+import {
+ NumberOrCallback,
+ OrientationTypes,
+ StringOrNumberOrCallback,
+ TextAnchorType,
+ VictoryNumberCallback,
+ VictoryStyleObject
+} from 'victory-core';
+import { VictoryTooltip } from 'victory-tooltip';
+import { ChartLegendTooltipLegend, defaultLegendProps } from './ChartLegendTooltipLegend';
+import { ChartLegendTooltipStyles, ChartThemeDefinition } from '../ChartTheme';
+import { ChartCursorTooltip, ChartCursorTooltipProps } from '../ChartTooltip';
+import { getLegendTooltipSize, getTheme } from '../ChartUtils';
+
+/**
+ * See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/victory/index.d.ts
+ */
+export interface ChartLegendTooltipProps extends ChartCursorTooltipProps {
+ /**
+ * The active prop specifies whether the tooltip component should be displayed.
+ */
+ active?: boolean;
+ /**
+ * When true, tooltip events will set the active prop on both data and label elements.
+ */
+ activateData?: boolean;
+ /**
+ * The angle prop specifies the angle to rotate the tooltip around its origin point.
+ */
+ angle?: string | number;
+ /**
+ * The center prop determines the position of the center of the tooltip flyout. This prop should be given as an object
+ * that describes the desired x and y svg coordinates of the center of the tooltip. This prop is useful for
+ * positioning the flyout of a tooltip independent from the pointer. When ChartTooltip is used with
+ * ChartVoronoiContainer, the center prop is what enables the mouseFollowTooltips option. When this prop is set,
+ * non-zero pointerLength values will no longer be respected.
+ */
+ center?: { x: number; y: number };
+ /**
+ * The centerOffset prop determines the position of the center of the tooltip flyout in relation to the flyout
+ * pointer. This prop should be given as an object of x and y, where each is either a numeric offset value or a
+ * function that returns a numeric value. When this prop is set, non-zero pointerLength values will no longer be
+ * respected.
+ */
+ centerOffset?: {
+ x?: NumberOrCallback;
+ y?: NumberOrCallback;
+ };
+ /**
+ * The constrainToVisibleArea prop determines whether to coerce tooltips so that they fit within the visible area of
+ * the chart. When this prop is set to true, tooltip pointers will still point to the correct data point, but the
+ * center of the tooltip will be shifted to fit within the overall width and height of the svg Victory renders.
+ */
+ constrainToVisibleArea?: boolean;
+ /**
+ * The cornerRadius prop determines corner radius of the flyout container. This prop may be given as a positive number
+ * or a function of datum.
+ */
+ cornerRadius?: NumberOrCallback;
+ /**
+ * Victory components can pass a data prop to their label component. This can be useful in custom components that need
+ * to make use of the entire dataset.
+ */
+ data?: any[];
+ /**
+ * Victory components can pass a datum prop to their label component. This can be used to calculate functional styles,
+ * and determine text.
+ */
+ datum?: {};
+ /**
+ * The dx prop defines a horizontal shift from the x coordinate.
+ */
+ dx?: NumberOrCallback;
+ /**
+ * The dy prop defines a vertical shift from the y coordinate.
+ */
+ dy?: NumberOrCallback;
+ /**
+ * The events prop attaches arbitrary event handlers to the label component. This prop should be given as an object of
+ * event names and corresponding event handlers. When events are provided via Victory’s event system, event handlers
+ * will be called with the event, the props of the component is attached to, and an eventKey.
+ * Examples: events={{onClick: (evt) => alert("x: " + evt.clientX)}}
+ */
+ events?: { [key: string]: (event: React.SyntheticEvent) => void };
+ /**
+ * The flyoutComponent prop takes a component instance which will be used to create the flyout path for each tooltip.
+ * The new element created from the passed flyoutComponent will be supplied with the following properties: x, y, dx, dy,
+ * index, datum, cornerRadius, pointerLength, pointerWidth, width, height, orientation, style, and events.
+ * Any of these props may be overridden by passing in props to the supplied component, or modified or ignored within
+ * the custom component itself. If flyoutComponent is omitted, a default Flyout component will be created with props
+ * described above.
+ * Examples: flyoutComponent={}, flyoutComponent={}
+ */
+ flyoutComponent?: React.ReactElement;
+ /**
+ * The flyoutHeight prop defines the height of the tooltip flyout. This prop may be given as a positive number or a function
+ * of datum. If this prop is not set, height will be determined based on an approximate text size calculated from the
+ * text and style props provided to ChartTooltip.
+ */
+ flyoutHeight?: NumberOrCallback;
+ /**
+ * The style prop applies SVG style properties to the rendered flyout container. These props will be passed to the
+ * flyoutComponent.
+ */
+ flyoutStyle?: VictoryStyleObject;
+ /**
+ * The flyoutWidth prop defines the width of the tooltip flyout. This prop may be given as a positive number or a
+ * function of datum. If this prop is not set, flyoutWidth will be determined based on an approximate text size
+ * calculated from the text and style props provided to VictoryTooltip.
+ */
+ flyoutWidth?: NumberOrCallback;
+ /**
+ * The groupComponent prop takes a component instance which will be used to create group elements for use within
+ * container elements. This prop defaults to a tag.}
+ */
+ groupComponent?: React.ReactElement;
+ /**
+ * This prop refers to the height of the svg that VictoryLabel is rendered within. This prop is passed from parents
+ * of VictoryLabel, and should not be set manually. In versions before ^33.0.0 this prop referred to the height of the
+ * tooltip flyout. Please use flyoutHeight instead
+ *
+ * **This prop should not be set manually.**
+ */
+ height?: number;
+ /**
+ * The horizontal prop determines whether to plot the flyouts to the left / right of the (x, y) coordinate rather than top / bottom.
+ * This is useful when an orientation prop is not provided, and data will determine the default orientation. i.e.
+ * negative values result in a left orientation and positive values will result in a right orientation by default.
+ */
+ horizontal?: boolean;
+ /**
+ * The index prop represents the index of the datum in the data array.
+ */
+ index?: number | string;
+ /**
+ * The labelComponent prop takes a component instance which will be used to render each tooltip label. The new element
+ * created from the passed labelComponent will be supplied with the following properties: x, y, index, datum,
+ * verticalAnchor, textAnchor, style, text, and events. Any of these props may be overridden by passing in props to
+ * the supplied component, or modified or ignored within the custom component itself. If labelComponent is omitted, a
+ * new ChartLabel will be created with the props described above.
+ * Examples: labelComponent={}, labelComponent={}
+ */
+ labelComponent?: React.ReactElement;
+ /**
+ * Defines how the labelComponent text is horizontally positioned relative to its `x` and `y` coordinates. Valid
+ * values are 'start', 'middle', 'end', and 'inherit'.
+ */
+ labelTextAnchor?: TextAnchorType | (() => TextAnchorType);
+ /**
+ * Specify data via the data prop. ChartLegend expects data as an
+ * array of objects with name (required), symbol, and labels properties.
+ * The data prop must be given as an array.
+ *
+ * @example legendData={[{ name: `GBps capacity - 45%` }, { name: 'Unused' }]}
+ */
+ legendData?: {
+ name?: string;
+ symbol?: {
+ fill?: string;
+ type?: string;
+ };
+ }[];
+ /**
+ * The orientation prop determines which side of the (x, y) coordinate the tooltip should be rendered on.
+ * This prop can be given as “top”, “bottom”, “left”, “right”, or as a function of datum that returns one of these
+ * values. If this prop is not provided it will be determined from the sign of the datum, and the value of the
+ * horizontal prop.
+ */
+ orientation?: OrientationTypes | VictoryNumberCallback;
+ /**
+ * The pointerLength prop determines the length of the triangular pointer extending from the flyout. This prop may be
+ * given as a positive number or a function of datum.
+ */
+ pointerLength?: NumberOrCallback;
+ /**
+ * This prop determines which side of the tooltip flyout the pointer should originate on. When this prop is not set,
+ * it will be determined based on the overall orientation of the flyout in relation to its data point, and any center
+ * or centerOffset values. Valid values are 'top', 'bottom', 'left' and 'right.
+ */
+ pointerOrientation?: OrientationTypes | ((...args: any[]) => OrientationTypes);
+ /**
+ * The pointerWidth prop determines the width of the base of the triangular pointer extending from
+ * the flyout. This prop may be given as a positive number or a function of datum.
+ */
+ pointerWidth?: NumberOrCallback;
+ /**
+ * When renderInPortal is true, rendered tooltips will be wrapped in VictoryPortal and rendered within the Portal element
+ * within ChartContainer. Note: This prop should not be set to true when using a custom container element.
+ */
+ renderInPortal?: boolean;
+ /**
+ * The style prop applies CSS properties to the rendered `` element.
+ */
+ style?: React.CSSProperties | React.CSSProperties[];
+ /**
+ * The text prop defines the text ChartTooltip will render. The text prop may be given as a string, number, or
+ * function of datum. When ChartLabel is used as the labelComponent, strings may include newline characters, which
+ * ChartLabel will split in to separate elements.
+ */
+ text?: StringOrNumberOrCallback | string[] | number[];
+ /**
+ * The theme prop specifies a theme to use for determining styles and layout properties for a component. Any styles or
+ * props defined in theme may be overwritten by props specified on the component instance.
+ */
+ theme?: ChartThemeDefinition;
+ /**
+ * Specifies the theme color. Valid values are 'blue', 'green', 'multi', etc.
+ *
+ * Note: Not compatible with theme prop
+ *
+ * @example themeColor={ChartThemeColor.blue}
+ */
+ themeColor?: string;
+ /**
+ * Specifies the theme variant. Valid values are 'dark' or 'light'
+ *
+ * Note: Not compatible with theme prop
+ *
+ * @example themeVariant={ChartThemeVariant.light}
+ */
+ themeVariant?: string;
+ /**
+ * The title prop specifies a title to render with the legend.
+ * This prop should be given as a string, or an array of strings for multi-line titles.
+ *
+ * Example: title={(datum) => datum.x}
+ */
+ title?: string | string[] | Function;
+ /**
+ * The x prop defines the x coordinate to use as a basis for horizontal positioning.
+ */
+ x?: number;
+ /**
+ * The y prop defines the y coordinate to use as a basis for vertical positioning.
+ */
+ y?: number;
+}
+
+export const ChartLegendTooltip: React.FunctionComponent = ({
+ datum,
+ labelComponent = ,
+ legendData,
+ themeColor,
+ themeVariant,
+ title,
+
+ // destructure last
+ theme = getTheme(themeColor, themeVariant),
+ ...rest
+}: ChartLegendTooltipProps) => {
+ // Returns the tooltip legend component
+ const getTooltipLegendComponent = () =>
+ React.cloneElement(labelComponent, {
+ data: legendData,
+ title,
+ ...labelComponent.props
+ });
+
+ // Returns legend dimensions
+ const getLegendDimensions = (props: any) => {
+ const legendComponent = getTooltipLegendComponent();
+ const getKeyValue = (key: string) =>
+ legendComponent.props[key] ? legendComponent.props[key] : (defaultLegendProps as any)[key];
+
+ const sizeProps = {
+ legendData,
+ legendProps: {
+ borderPadding: getKeyValue('borderPadding'),
+ gutter: getKeyValue('gutter'),
+ orientation: getKeyValue('orientation'),
+ padding: getKeyValue('padding'),
+ rowGutter: getKeyValue('rowGutter'),
+ standalone: getKeyValue('standalone'),
+ style: getKeyValue('style')
+ },
+ theme,
+ ...props // text
+ };
+ const legendDimensions = getLegendTooltipSize(sizeProps);
+ return legendDimensions;
+ };
+
+ // Returns flyout height based on legend size
+ const getFlyoutHeight = (props: any) => {
+ const legendComponent = getTooltipLegendComponent();
+ const height = getLegendDimensions(props).height + ChartLegendTooltipStyles.flyout.padding;
+ return legendComponent.props.title ? height : height - 10;
+ };
+
+ // Returns flyout width based on legend size
+ const getFlyoutWidth = (props: any) => {
+ const legendComponent = getTooltipLegendComponent();
+ return getLegendDimensions(props).width + ChartLegendTooltipStyles.flyout.padding;
+ };
+
+ return (
+
+
+
+ );
+};
+
+// Note: VictoryTooltip.defaultEvents must be hoisted
+hoistNonReactStatics(ChartLegendTooltip, VictoryTooltip);
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx
new file mode 100644
index 00000000000..8f9fe5af92c
--- /dev/null
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.test.tsx
@@ -0,0 +1,21 @@
+import * as React from 'react';
+import { shallow } from 'enzyme';
+import { ChartLegendTooltipLabel } from './ChartLegendTooltipLabel';
+
+Object.values([true, false]).forEach(() => {
+ test('ChartLegendTooltipLabel', () => {
+ const view = shallow();
+ expect(view).toMatchSnapshot();
+ });
+});
+
+test('renders component text', () => {
+ const legendData = [
+ { name: 'Cats' },
+ { name: 'Dogs', symbol: { type: 'dash' } },
+ { name: 'Birds' },
+ { name: 'Mice' }
+ ];
+ const view = shallow();
+ expect(view).toMatchSnapshot();
+});
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.tsx
new file mode 100644
index 00000000000..3977bb55d13
--- /dev/null
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLabel.tsx
@@ -0,0 +1,242 @@
+import * as React from 'react';
+import hoistNonReactStatics from 'hoist-non-react-statics';
+import { defaults } from 'lodash';
+import {
+ Helpers,
+ LabelOrientationType,
+ OriginType,
+ StringOrNumberOrCallback,
+ TextAnchorType,
+ VerticalAnchorType
+} from 'victory-core';
+import { VictoryLabel, VictoryLabelProps } from 'victory-core';
+import { ChartLabel } from '../ChartLabel';
+import { ChartLegendTooltipStyles } from '../ChartTheme';
+
+/**
+ * See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/victory/index.d.ts
+ */
+export interface ChartLegendLabelProps extends VictoryLabelProps {
+ /**
+ * The active prop specifies whether the label is active or not. The active prop is set by defaultEvents in components
+ * like ChartTooltip and VictorySelectionContainer. The active prop is used when evaluating functional styles and
+ * props.
+ */
+ active?: boolean;
+ /**
+ * Specifies the angle to rotate the text by.
+ */
+ angle?: string | number;
+ /**
+ * The capHeight prop defines a text metric for the font being used: the expected height of capital letters.
+ * This is necessary because of SVG, which (a) positions the *bottom* of the text at `y`, and (b) has no notion of
+ * line height. The value should ideally use the same units as `lineHeight` and `dy`, preferably ems. If given a
+ * unitless number, it is assumed to be ems.
+ */
+ capHeight?: StringOrNumberOrCallback;
+ /**
+ * The children of this component define the content of the label. This makes using the component similar to normal
+ * HTML spans or labels. strings, numbers, and functions of data / value are supported.
+ */
+ children?: StringOrNumberOrCallback;
+ /**
+ * The className prop specifies a class name that will be applied to the rendered text element.
+ */
+ className?: string;
+ /**
+ * Labels that apply to an entire data series will recieve the entire series as `data` instead of an individual datum
+ * prop.
+ */
+ data?: any[];
+ /**
+ * Victory components can pass a datum prop to their label component. This can be used to calculate functional styles,
+ * and determine child text
+ */
+ datum?: {};
+ /**
+ * 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.
+ */
+ desc?: string;
+ /**
+ * The direction prop determines which text direction to apply to the rendered text element
+ */
+ direction?: 'rtl' | 'ltr' | 'inherit';
+ /**
+ * The dx prop defines a horizontal shift from the `x` coordinate.
+ */
+ dx?: StringOrNumberOrCallback;
+ /**
+ * The dy prop defines a vertical shift from the `y` coordinate. Since this component already accounts for
+ * `capHeight`, `lineHeight`, and `verticalAnchor`, this will usually not be necessary.
+ */
+ dy?: StringOrNumberOrCallback;
+ /**
+ * The events prop attaches arbitrary event handlers to the label component.
+ * Event handlers are currently only called with their corresponding events.
+ */
+ events?: React.DOMAttributes;
+ /**
+ * The index prop represents the index of the datum in the data array. This prop should not be set manually.
+ */
+ index?: string | number;
+ /**
+ * When the text property contains an array of strings, the inline property lets the elements lay out next
+ * to each other. If this property is not specified, the elements will stack vertically instead.
+ */
+ inline?: boolean;
+ /**
+ * The labelPlacement prop is used to specify the placement of labels relative to the data point they represent.
+ * This prop may be given as “vertical”, “parallel” or “perpendicular”. This props is particularly useful in polar
+ * charts, where it may be desireable to position a label either parallel or perpendicular to its corresponding angle.
+ * When this prop is not set, perpendicular label placement will be used for polar charts, and vertical label
+ * placement will be used for cartesian charts.
+ */
+ labelPlacement?: LabelOrientationType;
+ /**
+ * Specify data via the data prop. ChartLegend expects data as an
+ * array of objects with name (required), symbol, and labels properties.
+ * The data prop must be given as an array.
+ *
+ * @example legendData={[{ name: `GBps capacity - 45%` }, { name: 'Unused' }]}
+ */
+ legendData?: {
+ name?: string;
+ symbol?: {
+ fill?: string;
+ type?: string;
+ };
+ }[];
+ /**
+ * The valueLabelComponent prop takes a component instance which will be used to render each legend tooltip.
+ */
+ legendLabelComponent?: React.ReactElement;
+ /**
+ * The lineHeight prop defines how much space a single line of text should take up.
+ * Note that SVG has no notion of line-height, so the positioning may differ slightly from what you would expect with CSS,
+ * but the result is similar: a roughly equal amount of extra space is distributed above and below the line of text.
+ * The value should ideally use the same units as `capHeight` and `dy`, preferably ems.
+ * If given a unitless number, it is assumed to be ems.
+ */
+ lineHeight?: StringOrNumberOrCallback;
+ /**
+ * Victory components will pass an origin prop is to define the center point in svg coordinates for polar charts.
+ *
+ * **This prop should not be set manually.**
+ */
+ origin?: OriginType;
+ /**
+ * Victory components can pass a boolean polar prop to specify whether a label is part of a polar chart.
+ *
+ * **This prop should not be set manually.**
+ */
+ polar?: boolean;
+ /**
+ * The renderInPortal prop specifies whether ChartLabel should render text in place or within a VictoryPortal.
+ * Setting renderInPortal to true is equivalent to wrapping ChartLabel in a VictoryPortal. This prop is false by default.
+ */
+ renderInPortal?: boolean;
+ /**
+ * Victory components can pass a scale prop to their label component. This can be used to calculate the position of
+ * label elements from datum. This prop should not be set manually.
+ */
+ scale?: { x?: any; y?: any };
+ /**
+ * The style prop applies CSS properties to the rendered `` element.
+ */
+ style?: React.CSSProperties | React.CSSProperties[];
+ /**
+ * The text prop defines the text ChartLabel will render. The text prop may be given as a string, number, a function
+ * of datum, or an array of any of these. Strings may include newline characters, which ChartLabel will split into
+ * separate elements. When text is given as an array, separate elements will be created for each
+ * element in the array.
+ */
+ text?: string[] | StringOrNumberOrCallback;
+ /**
+ * The textAnchor prop defines how the text is horizontally positioned relative to the given `x` and `y` coordinates.
+ * Options are "start", "middle" and "end". Note that this overrides the style prop.
+ */
+ textAnchor?: TextAnchorType | (() => TextAnchorType);
+ /**
+ * The transform prop applies a transform to the rendered `` element.
+ * In addition to being a string, it can be an object containing transform definitions for easier authoring.
+ */
+ transform?: string | {} | (() => string | {});
+ /**
+ * The verticalAnchor prop defines how the text is vertically positioned relative to the given `x` and `y`
+ * coordinates. Options are "start", "middle" and "end".
+ */
+ verticalAnchor?: VerticalAnchorType | (() => VerticalAnchorType);
+ /**
+ * This props refers to the width of the svg that VictoryLabel is rendered within. This prop is passed from parents
+ * of VictoryLabel.
+ *
+ * **This prop should not be set manually.**
+ */
+ width?: number;
+ /**
+ * The x prop defines the x coordinate to use as a basis for horizontal positioning.
+ */
+ x?: number;
+ /**
+ * The y prop defines the y coordinate to use as a basis for vertical positioning.
+ */
+ y?: number;
+}
+
+export const ChartLegendTooltipLabel: React.FunctionComponent = ({
+ dx = 0,
+ index = 0,
+ legendData,
+ legendLabelComponent = ,
+ style,
+ text,
+ textAnchor = 'end',
+ x,
+ y,
+
+ // destructure last
+ ...rest
+}: ChartLegendLabelProps) => {
+ const getStyle = (styles: any) => {
+ const applyDefaultStyle = (customStyle: React.CSSProperties) =>
+ defaults(
+ {
+ ...customStyle
+ },
+ {
+ fill: ChartLegendTooltipStyles.label.fill
+ }
+ );
+ return Array.isArray(styles) ? styles.map(applyDefaultStyle) : applyDefaultStyle(styles);
+ };
+
+ const getLegendLabelComponent = () => {
+ const label = legendData && legendData.length ? legendData[index as any].name : undefined;
+
+ return React.cloneElement(legendLabelComponent, {
+ style: getStyle({}),
+ text: label,
+ textAnchor: 'start',
+ x,
+ y
+ });
+ };
+
+ const getValueLabelComponent = () => {
+ const _x = x + Helpers.evaluateProp(dx);
+ return ;
+ };
+
+ const legendLabel = getLegendLabelComponent();
+ const valueLabel = getValueLabelComponent();
+ return (
+
+ {legendLabel}
+ {valueLabel}
+
+ );
+};
+
+// Note: VictoryLabel.role must be hoisted
+hoistNonReactStatics(ChartLegendTooltipLabel, VictoryLabel);
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLegend.test.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLegend.test.tsx
new file mode 100644
index 00000000000..c85eb6569c6
--- /dev/null
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLegend.test.tsx
@@ -0,0 +1,21 @@
+import * as React from 'react';
+import { shallow } from 'enzyme';
+import { ChartLegendTooltipLegend } from './ChartLegendTooltipLegend';
+
+Object.values([true, false]).forEach(() => {
+ test('ChartLegendTooltipLegend', () => {
+ const view = shallow();
+ expect(view).toMatchSnapshot();
+ });
+});
+
+test('renders component text', () => {
+ const legendData = [
+ { name: 'Cats' },
+ { name: 'Dogs', symbol: { type: 'dash' } },
+ { name: 'Birds' },
+ { name: 'Mice' }
+ ];
+ const view = shallow();
+ expect(view).toMatchSnapshot();
+});
diff --git a/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLegend.tsx b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLegend.tsx
new file mode 100644
index 00000000000..2ab21b31f2c
--- /dev/null
+++ b/packages/react-charts/src/components/ChartLegendTooltip/ChartLegendTooltipLegend.tsx
@@ -0,0 +1,437 @@
+import * as React from 'react';
+import hoistNonReactStatics from 'hoist-non-react-statics';
+import {
+ BlockProps,
+ ColorScalePropType,
+ EventCallbackInterface,
+ EventPropTypeInterface,
+ Helpers,
+ NumberOrCallback,
+ OrientationTypes,
+ PaddingProps,
+ StringOrNumberOrCallback,
+ StringOrNumberOrList,
+ VictoryStyleInterface,
+ VictoryStyleObject
+} from 'victory-core';
+import { VictoryLegend, VictoryLegendOrientationType, VictoryLegendTTargetType } from 'victory-legend';
+import { ChartLabel } from '../ChartLabel';
+import { ChartLegend, ChartLegendProps } from '../ChartLegend';
+import { ChartLegendTooltipLabel } from './ChartLegendTooltipLabel';
+import { ChartLegendTooltipStyles, ChartThemeDefinition } from '../ChartTheme';
+import { getLegendTooltipSize, getTheme } from '../ChartUtils';
+
+/**
+ * See https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/victory/index.d.ts
+ */
+// Overriding title prop
+// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
+// @ts-ignore
+export interface ChartLegendTooltipLegendProps extends ChartLegendProps {
+ /**
+ * The borderComponent prop takes a component instance which will be responsible
+ * for rendering a border around the legend. The new element created from the passed
+ * borderComponent will be provided with the following properties calculated by
+ * ChartLegend: x, y, width, height, and style. Any of these props may be
+ * overridden by passing in props to the supplied component, or modified or ignored
+ * within the custom component itself. If a borderComponent
+ * is not provided, ChartLegend will use its default Border component.
+ * Please note that the default width and height calculated
+ * for the border component is based on approximated
+ * text measurements, and may need to be adjusted.
+ */
+ borderComponent?: React.ReactElement;
+ /**
+ * The borderPadding specifies the amount of padding that should
+ * be added between the legend items and the border. This prop may be given as
+ * a number, or asanobject with values specified for top, bottom, left, and right.
+ * Please note that the default width and height calculated for the border
+ * component is based on approximated text measurements, so padding may need to be adjusted.
+ */
+ borderPadding?: PaddingProps;
+ /**
+ * The centerTitle boolean prop specifies whether a legend title should be centered.
+ */
+ centerTitle?: boolean;
+ /**
+ * The colorScale prop defines a color scale to be applied to each data
+ * symbol in ChartLegend. This prop should be given as an array of CSS
+ * colors, or as a string corresponding to one of the built in color
+ * scales: "grayscale", "qualitative", "heatmap", "warm", "cool", "red",
+ * "green", "blue". ChartLegend will assign a color to each symbol by
+ * index, unless they are explicitly specified in the data object.
+ * Colors will repeat when there are more symbols than colors in the
+ * provided colorScale.
+ */
+ colorScale?: ColorScalePropType;
+ /**
+ * The containerComponent prop takes an entire component which will be used to
+ * create a container element for standalone charts.
+ * The new element created from the passed containerComponent wil be provided with
+ * these props from ChartLegend: height, width, children
+ * (the chart itself) and style. Props that are not provided by the
+ * child chart component include title and desc, both of which
+ * are intended to add accessibility to Victory components. The more descriptive these props
+ * are, the more accessible your data will be for people using screen readers.
+ * Any of these props may be overridden by passing in props to the supplied component,
+ * or modified or ignored within the custom component itself. If a dataComponent is
+ * not provided, ChartLegend will use the default ChartContainer component.
+ *
+ * @example
+ */
+ containerComponent?: React.ReactElement;
+ /**
+ * Specify data via the data prop. ChartLegend expects data as an
+ * array of objects with name (required), symbol, and labels properties.
+ * The data prop must be given as an array.
+ */
+ data?: {
+ name?: string;
+ labels?: {
+ fill?: string;
+ };
+ symbol?: {
+ fill?: string;
+ type?: string;
+ };
+ }[];
+ /**
+ * The dataComponent prop takes a component instance which will be
+ * responsible for rendering a data element used to associate a symbol
+ * or color with each data series. The new element created from the
+ * passed dataComponent will be provided with the following properties
+ * calculated by ChartLegend: x, y, size, style, and symbol. Any of
+ * these props may be overridden by passing in props to the supplied
+ * component, or modified or ignored within the custom component itself.
+ * If a dataComponent is not provided, ChartLegend will use its
+ * default Point component.
+ */
+ dataComponent?: React.ReactElement;
+ /**
+ * Victory components can pass a datum prop to their label component. This can be used to calculate functional styles,
+ * and determine child text
+ */
+ datum?: {};
+ /**
+ * The dx prop defines a horizontal shift from the x coordinate.
+ */
+ dx?: NumberOrCallback;
+ /**
+ * The dy prop defines a horizontal shift from the y coordinate.
+ */
+ dy?: NumberOrCallback;
+ /**
+ * ChartLegend uses the standard eventKey prop to specify how event targets
+ * are addressed. This prop is not commonly used.
+ */
+ eventKey?: StringOrNumberOrCallback | string[];
+ /**
+ * ChartLegend uses the standard events prop.
+ */
+ events?: EventPropTypeInterface[];
+ /**
+ * ChartLegend uses the standard externalEventMutations prop.
+ */
+ externalEventMutations?: EventCallbackInterface[];
+ /**
+ * The groupComponent prop takes an entire component which will be used to
+ * create group elements for use within container elements. This prop defaults
+ * to a tag on web, and a react-native-svg tag on mobile
+ */
+ groupComponent?: React.ReactElement;
+ /**
+ * The gutter prop defines the number of pixels between legend rows or
+ * columns, depending on orientation. When orientation is horizontal,
+ * gutters are between columns. When orientation is vertical, gutters
+ * are the space between rows.
+ */
+ gutter?: number | { left: number; right: number };
+ /**
+ * Specifies the height the svg viewBox of the chart container. This value should be given as a
+ * number of pixels.
+ *
+ * Because Victory renders responsive containers, the width and height props do not determine the width and
+ * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of
+ * pixels will depend on the size of the container the chart is rendered into.
+ */
+ height?: number;
+ /**
+ * The itemsPerRow prop determines how many items to render in each row
+ * of a horizontal legend, or in each column of a vertical legend. This
+ * prop should be given as an integer. When this prop is not given,
+ * legend items will be rendered in a single row or column.
+ */
+ itemsPerRow?: number;
+ /**
+ * The labelComponent prop takes a component instance which will be used
+ * to render each legend label. The new element created from the passed
+ * labelComponent will be supplied with the following properties: x, y,
+ * style, and text. Any of these props may be overridden by passing in
+ * props to the supplied component, or modified or ignored within the
+ * custom component itself. If labelComponent is omitted, a new
+ * ChartLabel will be created with the props described above.
+ */
+ labelComponent?: React.ReactElement;
+ /**
+ * The orientation prop takes a string that defines whether legend data
+ * are displayed in a row or column. When orientation is "horizontal",
+ * legend items will be displayed in a single row. When orientation is
+ * "vertical", legend items will be displayed in a single column. Line
+ * and text-wrapping is not currently supported, so "vertical"
+ * orientation is both the default setting and recommended for
+ * displaying many series of data.
+ */
+ orientation?: VictoryLegendOrientationType;
+ /**
+ * The padding props specifies the amount of padding in number of pixels between
+ * the edge of the chart and any rendered child components. This prop can be given
+ * as a number or as an object with padding specified for top, bottom, left
+ * and right.
+ */
+ padding?: PaddingProps;
+ /**
+ * The responsive prop specifies whether the rendered container should be a responsive container with a viewBox
+ * attribute, or a static container with absolute width and height.
+ *
+ * Useful when legend is located inside a chart -- default is false.
+ *
+ * Note: Not compatible with containerComponent prop
+ */
+ responsive?: boolean;
+ /**
+ * The rowGutter prop defines the number of pixels between legend rows.
+ * This prop may be given as a number, or as an object with values
+ * specified for “top” and “bottom” gutters. To set spacing between columns,
+ * use the gutter prop.
+ */
+ rowGutter?: number | Omit;
+ /**
+ * The sharedEvents prop is used internally to coordinate events between components.
+ *
+ * **This prop should not be set manually.**
+ */
+ sharedEvents?: { events: any[]; getEventState: Function };
+ /**
+ * The standalone prop determines whether the component will render a standalone svg
+ * or a tag that will be included in an external svg. Set standalone to false to
+ * compose ChartLegend with other components within an enclosing