GridChartDesigner

Subclass of ChartDesigner that draws data series and values from the selection of the configured Grid.

Grid chart designer
//<code-header>
fiddle.title = 'Grid chart designer';
//</code-header>
class WeatherObservation extends Model {
    static fields = [{
        name : 'date',
        type : 'date'
    }, {
        name : 'temperature',
        type : 'number'
    }, {
        name : 'humidity',
        type : 'number'
    }, {
        name : 'windSpeed',
        type : 'number'
    }, {
        name : 'precipitation',
        type : 'number'
    }, {
        name : 'pressure',
        type : 'number'
    }];

    static idField = 'chartTypeId';
}

const records = [
    {
        id            : 1,
        date          : '2023-01-31',
        temperature   : 22.49,
        humidity      : 31.24,
        windSpeed     : 12.24,
        precipitation : 60.75,
        pressure      : 962.20
    },
    {
        id            : 2,
        date          : '2023-02-28',
        temperature   : 34.01,
        humidity      : 88.19,
        windSpeed     : 2.79,
        precipitation : 17.05,
        pressure      : 999.52
    },
    {
        id            : 3,
        date          : '2023-03-31',
        temperature   : 29.64,
        humidity      : 79.95,
        windSpeed     : 5.84,
        precipitation : 6.51,
        pressure      : 953.44
    },
    {
        id            : 4,
        date          : '2023-04-30',
        temperature   : 26.97,
        humidity      : 42.74,
        windSpeed     : 7.33,
        precipitation : 94.89,
        pressure      : 1040.93
    },
    {
        id            : 5,
        date          : '2023-05-31',
        temperature   : 18.12,
        humidity      : 40.91,
        windSpeed     : 9.12,
        precipitation : 96.56,
        pressure      : 975.88
    },
    {
        id            : 6,
        date          : '2023-06-30',
        temperature   : 18.12,
        humidity      : 41.00,
        windSpeed     : 15.70,
        precipitation : 80.84,
        pressure      : 1016.25
    },
    {
        id            : 7,
        date          : '2023-07-31',
        temperature   : 16.16,
        humidity      : 48.25,
        windSpeed     : 3.99,
        precipitation : 30.46,
        pressure      : 981.17
    },
    {
        id            : 8,
        date          : '2023-08-31',
        temperature   : 32.32,
        humidity      : 61.49,
        windSpeed     : 10.28,
        precipitation : 9.77,
        pressure      : 1002.01
    },
    {
        id            : 9,
        date          : '2023-09-30',
        temperature   : 27.02,
        humidity      : 55.92,
        windSpeed     : 11.85,
        precipitation : 68.42,
        pressure      : 1004.67
    },
    {
        id            : 10,
        date          : '2023-10-31',
        temperature   : 29.16,
        humidity      : 47.47,
        windSpeed     : 0.93,
        precipitation : 44.02,
        pressure      : 968.49
    }
].map(data => new WeatherObservation(data));

const grid = new Grid({
    height  : '20em',
    width   : '100%',
    columns : [
        {
            id    : 1,
            text  : 'Date',
            field : 'date',
            flex  : 1
        },
        {
            id    : 2,
            text  : 'Temperature',
            field : 'temperature',
            type  : 'number'
        },
        {
            id    : 3,
            text  : 'Humidity',
            field : 'humidity',
            type  : 'number'
        },
        {
            id    : 4,
            text  : 'Wind Speed',
            field : 'windSpeed',
            type  : 'number'
        },
        {
            id    : 5,
            text  : 'Precipitation',
            field : 'precipitation',
            type  : 'number'
        },
        {
            id    : 6,
            text  : 'Pressure',
            field : 'pressure',
            type  : 'number'
        }
    ],
    store : {
        modelClass : WeatherObservation,
        data       : records
    },
    selectionMode : {
        cell       : true,
        column     : true,
        dragSelect : true
    },
    features : {
        group : false
    }
});

new Container({
    appendTo : targetElement,
    items    : [
        {
            type   : 'gridchartdesigner',
            width  : '100%',
            height : '400px',
            grid,
            sync   : true
        },
        grid
    ]
});

grid.selectCellRange({ rowIndex : 0, columnIndex : 0 }, { rowIndex : 9, columnIndex : 4 });

Configs

76

Common

listenersEvents

Other

Grid whose selected cells will provide the data series for the chart. Columns in the grid will become series available for use in the chart designer, and cell values in the selected cells becomes data values shown in the preview chart.

sync: Boolean= false

Whether to update the chart designer's data series options and preview data as the grid selection changes.

columnWidget
rtlRTL
spanWidget

Accessibility

ariaLabelWidget
keyMapKeyMap

CSS

clsWidget
colorWidget
htmlClsWidget
styleWidget
uiWidget

DOM

adoptWidget
appendToWidget
contentWidget
datasetWidget
htmlWidget
idWidget
tagWidget
titleWidget

Float & align

alignWidget
anchorWidget
centeredWidget
draggableWidget
floatingWidget
xWidget
yWidget

Layout

alignSelfWidget
dockWidget
flexWidget
heightWidget
hiddenWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
textAlignWidget
weightWidget
widthWidget

Misc

dataFieldWidget
disabledWidget
localeClassLocalizable
localizableLocalizable
maskedWidget
ownerWidget
readOnlyWidget
refWidget
rippleWidget
tabWidget
tooltipWidget

Scrolling

Properties

65

Class hierarchy

isGridChartDesigner: Boolean= truereadonly
Identifies an object as an instance of GridChartDesigner class, or subclass thereof.
isGridChartDesigner: Boolean= truereadonlystatic
Identifies an object as an instance of GridChartDesigner class, or subclass thereof.
isDelayableDelayable
isEventsEvents
isKeyMapKeyMap
isLocalizableLocalizable
isWidgetWidget

Accessibility

keyMapKeyMap

CSS

clsWidget

DOM

appendToWidget
contentWidget
datasetWidget
elementWidget
htmlWidget
idWidget
styleWidget

Float & align

xWidget
yWidget

Layout

alignSelfWidget
flexWidget
heightWidget
marginWidget
maxHeightWidget
maxWidthWidget
minHeightWidget
minWidthWidget
widthWidget

Lifecycle

configBase

Misc

cellInfoWidget
disabledWidget
localeHelperLocalizable
localeManagerLocalizable
readOnlyWidget
refWidget
tabWidget
tooltipWidget

Other

$namestaticWidget
columnWidget
rtlRTL
spanWidget
typestaticWidget

Visibility

hiddenWidget
isVisibleWidget

Widget hierarchy

ownerWidget
parentWidget

Functions

58

Configuration

applyDefaultsstaticBase

Events

Float & align

alignToWidget
setXYWidget
showByWidget
toFrontWidget

Lifecycle

createstaticWidget
destroystaticBase
initClassstaticWidget

Misc

attachTooltipstaticWidget
fromElementstaticWidget
fromSelectorstaticWidget
getByIdstaticWidget
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

composeWidget
createOnFrameDelayable
disableWidget
enableWidget
focusWidget
LstaticLocalizable
maskWidget
onEvents
recomposeWidget
relayAllEvents
triggerEvents
unEvents
unmaskWidget

Visibility

hideWidget
showWidget

Widget hierarchy

closestWidget
containsWidget
ownsWidget
queryWidget
queryAllWidget
upWidget

Events

14
catchAllEvents
destroyEvents
focusInWidget
focusOutWidget
hideWidget
paintWidget
readOnlyWidget
recomposeWidget
resizeWidget
showWidget

Event handlers

14

Typedefs

6

CSS variables

20

Inherited