Skip to main content

Interface: BarChartOptions

Defined in: mobjects/graphing/BarChart.ts:25

Options for creating a BarChart

Properties

axisColor?

optional axisColor: string

Defined in: mobjects/graphing/BarChart.ts:51

Color for axes. Default: '#ffffff'


barColors?

optional barColors: string | string[]

Defined in: mobjects/graphing/BarChart.ts:35

Bar colors. Single color applies to all, array cycles through bars/series. Default: Manim color palette


barFillOpacity?

optional barFillOpacity: number

Defined in: mobjects/graphing/BarChart.ts:37

Fill opacity for bars. Default: 0.8


barGap?

optional barGap: number

Defined in: mobjects/graphing/BarChart.ts:31

Gap between bars within a group (for grouped bars). Default: 0.05


barStrokeWidth?

optional barStrokeWidth: number

Defined in: mobjects/graphing/BarChart.ts:39

Stroke width for bar outlines. Default: 2


barWidth?

optional barWidth: number

Defined in: mobjects/graphing/BarChart.ts:29

Width of each bar. Default: 0.6


groupGap?

optional groupGap: number

Defined in: mobjects/graphing/BarChart.ts:33

Gap between bar groups. Default: 0.25


height?

optional height: number

Defined in: mobjects/graphing/BarChart.ts:47

Visual height of the chart area. Default: 5


includeYLabels?

optional includeYLabels: boolean

Defined in: mobjects/graphing/BarChart.ts:55

Whether to include y-axis number labels. Default: true


includeYTicks?

optional includeYTicks: boolean

Defined in: mobjects/graphing/BarChart.ts:53

Whether to include y-axis tick marks. Default: true


seriesNames?

optional seriesNames: string[]

Defined in: mobjects/graphing/BarChart.ts:59

Series names for legend (grouped bars). Default: []


showLegend?

optional showLegend: boolean

Defined in: mobjects/graphing/BarChart.ts:61

Whether to show a legend. Default: false


values

values: number[] | number[][]

Defined in: mobjects/graphing/BarChart.ts:27

Array of values for the bars. For grouped bars, use 2D array [[series1], [series2], ...]


width?

optional width: number

Defined in: mobjects/graphing/BarChart.ts:49

Visual width of the chart area. Default: 8


xLabelFontSize?

optional xLabelFontSize: number

Defined in: mobjects/graphing/BarChart.ts:43

Font size for x-axis labels. Default: 24


xLabels?

optional xLabels: string[]

Defined in: mobjects/graphing/BarChart.ts:41

X-axis labels for each bar/group. Default: []


yLabelFontSize?

optional yLabelFontSize: number

Defined in: mobjects/graphing/BarChart.ts:57

Font size for y-axis labels. Default: 20


yRange?

optional yRange: [number, number, number]

Defined in: mobjects/graphing/BarChart.ts:45

Y-axis range as [min, max, step]. Default: auto-calculated from values