ColumnGraph
import {ColumnGraph} from 'cx/charts';The ColumnGraph widget is used to display a series of vertical bars.
<div class="widgets" controller={PageController}> <Legend /> <Svg style="width:600px; height:400px;"> <Chart offset="20 -20 -100 40" axes={{ x: { type: CategoryAxis, snapToTicks: 0, labelWrap: true, labelOffset: 15, labelRotation: -45, labelDy: '0.3em', labelAnchor: 'end', labelLineCountDyFactor: -0.5 }, y: { type: NumericAxis, vertical: true, snapToTicks: 1 } }} > <Gridlines/> <ColumnGraph data-bind="$page.points" colorIndex={0} active-bind="$page.showV1" name="V1" size={0.3} offset={-0.15} yField="v1" selection={{ type: KeySelection, bind: '$page.selected.x', keyField: 'x' }} /> <ColumnGraph data-bind="$page.points" colorIndex={6} active-bind="$page.showV2" name="V2" size={0.3} offset={+0.15} yField="v2" selection={{ type: KeySelection, bind: '$page.selected.x', keyField: 'x' }} /> </Chart> </Svg> </div>
| Property | Description | Type |
|---|---|---|
autoSize | Set to | boolean |
borderRadius | Border radius of the column/bar. Default is | 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 | string |
colorName | Name used to automatically resolve color based from the contextual | string |
data | Data for the graph. Each entry should be an object with at least two properties whose names should match the
| array |
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 | 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 | boolean |
xAxis | Name of the horizontal axis. The value should match one of the horizontal axes set in the | string |
xField | Name of the property which holds the x value. Default value is | string |
y0 | Column base value. Default value is | number |
y0Field | Name of the property which holds the base value. Default value is | string | false |
yAxis | Name of the vertical axis. The value should match one of the vertical axes set in the | string |
yField | Name of the property which holds the y value. Default value is | string |
active | Used to indicate if an item is active or not. Inactive items are shown only in the legend. | boolean |
class | 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 | boolean |
hoverChannel | A value used to identify the group of components participating in hover effect synchronization. See HoverSync. | string |
hoverId | A value used to uniquely identify the record within the hover sync group. See HoverSync. | string |
legend | Name of the legend to be used. Default is | string | false |
legendAction | Action to be performed if the user clicks on the legend entry. Default value is | 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 | string |
stack | Name of the stack. If multiple stacks are used, each should have a unique name.
Default value is | 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 |