chart.height & chart.width

Configuration Structure

chart: {
height: string | number,
}

height and width control the size of the chart. Both accept a number (treated as pixels), a pixel string like '400px', or a percentage like '100%'. By default the width fills its container and the height is derived from the golden ratio. They are part of the chart configuration.

height

Default: 'auto'

Height of the chart. The default value 'auto' is calculated based on the golden ratio 1.618 which makes a height roughly 61.8% of its width. Accepts Number (400) or String ('400px' or '100%')

A percentage is a share of the parent element's height, so give the parent a height of its own (a fixed height, or a flex or grid cell that sizes it). In a parent sized only by its content, such as a card holding a heading and the chart, use 8.8.1 or newer: 8.7.0 and 8.8.0 let such a chart grow taller on every redraw.

width

Width of the chart. Accepts Number (400) which is treated as pixels or String ('400px' or '100%')