ChartColumn

A column that displays a Chart in each cell.

Records for the chart are provided by the field defined in the column configuration. Values will be read from that field on the grid record model for a given row. The value of the field should be an array of records of chart data, each containing the fields required by the chart's defined series and labels.

By default, the chart will update when its store fires a change event. To disable auto-sync, set the autoSync property of the chart config to false.

new Grid({
    columns : [
        {
             type: 'chart',

             chart : {
                 chartType : 'line',
                 series : [{
                     field : 'price'
                 },{
                     field : 'changePct'
                 }],
                 labels : {
                     field : 'symbol'
                 }
             }
        }
    ]
});

Chart column
//<code-header>
fiddle.title = 'Chart column';
//</code-header>
class Row extends GridRowModel {
    static fields = [
        { name : 'name' },
        { name : 'monthlySales' }
    ];
}

const
    months = ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
    products = [
        'Blue jeans mens L', 'Sweatshirt XL', 'Black turtleneck womens M'
    ],
    data = ArrayHelper.populate(3, n => ({
        id           : n + 1,
        name         : products[n],
        monthlySales : months.map(m => ({
            value : Math.round(Math.random() * 80 + 20),
            label : m
        }))
    }));

const grid = new Grid({
    appendTo   : targetElement,
    autoHeight : true,
    rowHeight  : 80,
    data,
    columns    : [
        {
            text   : 'Name',
            field  : 'name',
            width  : 300,
            editor : {
                type     : 'textfield',
                required : true
            }
        },
        {
            text  : 'Sales',
            width : 120,
            type  : 'chart',
            field : 'monthlySales',
            chart : {
                chartType : 'line',
                showLabel : true,
                showAxes  : true,
                series    : [{
                    field : 'value'
                }],
                labels : {
                    field : 'label'
                }
            }
        }
    ]
});

Note that this column requires using thin bundles or thin npm packages in your application, and importing the chart bundle / package. It does not work with normal packages, module or umd bundles.

Configs

83

Common

autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
listenersEvents
maxWidthColumn
textColumn
widgetsWidgetColumn
widthColumn

Other

The Chart widget configuration. Since charts are imported from a separate module, the chart class will be lazy loaded when this column is used.

formulaColumn
pinnedColumn
readOnlyColumn

Rendering

chartCls: String

CSS class name to add to chart.

afterRenderCellWidgetColumn
cellClsColumn
clsColumn
iconColumn
rendererWidgetColumn
tooltipColumn

Accessibility

ariaLabelColumn

Export

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

Layout

alignColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Menu

Merge cells

mergeableColumn

Misc

localeClassLocalizable
localizableLocalizable
tagsColumn
treeColumn

Summary

sumColumn
summariesColumn

Properties

153

Common

autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
maxWidthColumn
textColumn
widgetsWidgetColumn
widthColumn

Class hierarchy

isChartColumn: Boolean= truereadonly
Identifies an object as an instance of ChartColumn class, or subclass thereof.
isChartColumn: Boolean= truereadonlystatic
Identifies an object as an instance of ChartColumn class, or subclass thereof.
isColumnColumn
isEventsEvents
isLocalizableLocalizable
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode
isWidgetColumnWidgetColumn

Other

The Chart widget configuration. Since charts are imported from a separate module, the chart class will be lazy loaded when this column is used.

$namestaticModel
defaultsColumn
elementColumn
formulaColumn
gridColumn
pinnedColumn
readOnlyColumn
relationsstaticModel
subGridColumn
typestaticColumn
visibleColumn

Accessibility

ariaLabelColumn

Editing

copyOfModel
isValidModel

Export

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

JSON

jsonModel

Layout

alignColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Menu

Merge cells

mergeableColumn

Misc

localeHelperLocalizable
localeManagerLocalizable
stmModelStm
tagsColumn
treeColumn

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Rendering

afterRenderCellWidgetColumn
cellClsColumn
clsColumn
iconColumn
rendererWidgetColumn
tooltipColumn

Summary

sumColumn
summariesColumn

Functions

78

Configuration

applyDefaultsstaticBase

Editing

copyModel
getDataModel
removeModel
setModel

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase
optionalLstaticLocalizable

Other

hideColumn
LstaticLocalizable
onEvents
relayAllEvents
showColumn
toggleColumn
triggerEvents
unEvents

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Events

5

Event handlers

5

Typedefs

2