CxJS

BarGraph

The BarGraph widget is used to display a series of horizontal bars.

Import: import { BarGraph } from 'cx/charts';

Example

<Chart
  axes={{ x: { type: NumericAxis }, y: { type: CategoryAxis, vertical: true } }}
>
  <Gridlines />
  <BarGraph
    data-bind="data"
    xField="value"
    yField="city"
    colorIndex={0}
    size={0.6}
  />
</Chart>
Q1
Q2

Properties

PropertyTypeDefaultDescription
dataSx<Array>undefinedArray of data points
xFieldstring"x"Field for x-axis values
yFieldstring"y"Field for y-axis (category) values
colorIndexnumberundefinedColor palette index
sizenumber0.5Bar width (0-1)
stackedbooleanfalseStack multiple bar series
autoSizebooleanfalseAuto-adjust bar size