Namespace: ReactWrapper

ReactWrapper

The ReactWrapper namespace contains the CompactChart React wrapper component as well as some useful types.

Since:
  • 10.3.0

Methods


CompactChartComponent(props)

A CompactChart React wrapper component.

Parameters:
Name Type Description
props CompactChartComponentProps

Component properties.

Since:
  • 10.3.0

Returns:

A React component wrapping a CompactChart.

Type
React.ReactNode
Example

Creating the wrapper component in a JSX. Full example can be found in react-example folder in your distribution.

const App = () => {
	// This will be the instance of the CompactChart created by the component.
	const handle = useRef({});

	return (
		<div style={{ marginLeft: "15px" }}>
			<CompactChartComponent
				chartHandle={handle}
				compactChartClass={CompactChart}
				config={config}
				containerWidth={"100%"}
				containerHeight={"600px"}
			/>
		</div>
	);
};

Type Definitions


CompactChartComponentProps

Properties consumed by the CompactChartComponent.

Type:
  • object
Properties:
Name Type Argument Default Description
chartHandle React.RefObject.<(CompactChartHandle|null)> <optional>

Ref of the component, to contain a handle to the CompactChart instance created.

compactChartClass CompactChart

The CompactChart class. This will be used to create the chart.

config Config

The chart configuration object. This config is overlaid onto the config specified by the configTemplate field.

containerWidth string <optional>
'100%'

The width of the chart container.

containerHeight string <optional>
'200px'

The height of the chart container.

Since:
  • 10.3.0


CompactChartHandle

Describes what is in the Ref.

Type:
  • object
Properties:
Name Type Argument Description
chart CompactChart <optional>

The CompactChart instance.

Since:
  • 10.3.0


StaticData

A useful type to cast static data when used in the CompactChart configuration.

Type:
Since:
  • 10.3.0