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'
}
}
}
]
});
//<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'
}
}
}
]
});chart
bundle / package. It does not work with normal packages, module or umd bundles.
Configs
83
Configs
83Common
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.
Rendering
CSS class name to add to chart.
Integration
Interaction
Menu
Misc
Properties
153
Properties
153Common
Class hierarchy
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.