Documentation

Report Edit

Column

import {Column} from 'cx/charts';

The Column widget is used to make column charts where each column has unique properties or additional content inside.

HintzchesterWest AlexievilleSouth WendyburyNorth KatharinamouthLake GermaineYvonnemouthElinoreburyWest HowellLake GlenWest CarmelstadGardnerburghVellalandAllanhavenPaulafurtEast AniyaJoshburyLake MarinaNew BessietonNorth JaredPort BridgetShanahanshireAshlynnburghVirgilchesterWest EmelieJuanitachesterWest GenovevaportNew LorenBrucetonNew JesseSouth Zion01020304050
ControllerIndex
<Svg style="width:600px; height:400px;">
   <Chart offset="20 -20 -140 40" axes={{
      x: { type: CategoryAxis, labelRotation: -90, labelDy: '0.4em', labelAnchor: "end" },
      y: { type: NumericAxis, vertical: true } }}>
      <Gridlines/>
      <Repeater records-bind="$page.points" recordAlias="$point">
         <Column colorIndex-expr="15 - Math.round({$point.y}*6/50)"
               width={0.8}
               x-bind="$point.x"
               y-bind="$point.y"
               tooltip-tpl="{$point.x} {$point.y:n;0}" />
      </Repeater>
   </Chart>
</Svg>
<Legend />
Copied!Cx Fiddle
PropertyDescriptionType
autoSize

Set to true to auto calculate size and offset. Available only if the x axis is a category axis.

boolean
borderRadius

Border radius of the column/bar. Default 0

number
colorIndex

Index of a color from the standard palette of colors. 0-15.

number
colorMap

Used to automatically assign a color based on the colorName and the contextual ColorMap widget.

string
colorName

Name used to automatically resolve color based from the contextual ColorMap widget. If value is not provided, name is used instead.

string
name

Name of the item as it will appear in the legend.

string
offset

Of center offset of the column. Use this in combination with size to align multiple series on the same chart.

number
size

Size (width) of the column in axis units.

number
stacked

Indicate that columns should be stacked on top of the other columns. Default value is false.

boolean
x

The x value binding or expression.

string/number
xAxis

Name of the horizontal axis. The value should match one of the horizontal axes set in the axes configuration of the parent Chart component. Default value is x.

string
y

The y value binding or expression.

string/number
y0

Column base value. Default value is 0.

number
yAxis

Name of the vertical axis. The value should match one of the vertical axes set in the axes configuration if the parent Chart component. Default value is y.

string
active

Used to indicate if an item is active or not. Inactive items are shown only in the legend.

boolean
class
className

Additional CSS classes to be applied to the element. If an object is provided, all keys with a "truthy" value will be added to the CSS class list.

string/object
hiddenBase

If set to true, the chart can clip the base of the graph and show only the appropriate range that contains the values. Default value is false.

boolean
items
children

List of child elements.

array
layout

Define an inner layout.

string/object
legend

Name of the legend to be used. Default is legend. Set to false to hide legend entry for this item.

string | false
legendAction

Action to be performed if the user clicks on the legend entry. Default value is auto. Other permitted values are toggle and select.

string
legendShape

Shape of the icon in the the legend. Default value is based on the chart type. Additional shapes can be registered using the registerShape function. Out of the box, CxJS offers square, bar, column, line, vline and triangle shapes.

string
minPixelHeight

Minimum column size in pixels. Useful for indicating very small values. Default value is 0.5.

number
mod

Appearance modifier. For example, mod="big" will add the CSS class .cxm-big to the block element.

string/array
outerLayout

Defines the outer layout which wraps the widget.

widget
plainText

Set to true to avoid converting inner strings to templates. Default is false.

boolean
preserveWhitespace
ws

Keep whitespace in text based children. Default is false. See also trimWhitespace.

boolean
putInto
contentFor

Used with outer layouts. Specifies the name of the content placeholder which should render the widget.

string
stack

Name of the stack. If multiple stacks are used, each should have a unique name. Default value is stack.

string
style

Style object applied to the wrapper div. Used for setting the dimensions of the element.

string/object
tooltip

Tooltip configuration. For more info see Tooltips.

string/object
trimWhitespace

Remove all whitespace in text based children. Default is true. See also preserveWhitespace.

boolean
vdomKey

Key that will be used as the key when rendering the React component.

string
visible
if

Visibility of the widget. Defaults to true.

boolean