How to use the ag-grid-community.ChartType function in ag-grid-community

To help you get started, we’ve selected a few ag-grid-community examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / chartProxies / cartesian / scatterChartProxy.js View on Github external
}
                scatterSeries.data = params.data;
                scatterSeries.yField = f.colId;
                scatterSeries.yFieldName = f.displayName;
                var palette = _this.overriddenPalette ? _this.overriddenPalette : _this.chartProxyParams.getSelectedPalette();
                var fills = palette.fills;
                scatterSeries.fill = fills[index % fills.length];
                var strokes = palette.strokes;
                scatterSeries.stroke = strokes[index % strokes.length];
                if (!existingSeries) {
                    chart.addSeries(scatterSeries);
                }
            }
        };
        if (defaultCategorySelected) {
            if (chartType === ag_grid_community_1.ChartType.Bubble) {
                // only update bubble chart if the correct number of fields are present
                var len = params.fields.length;
                var offset = len % 2 === 0 ? 1 : 0;
                var fields = [];
                for (var i = 1; i < len - offset; i += 2) {
                    fields.push(params.fields[i]);
                }
                fields.forEach(updateFunc);
            }
            else {
                params.fields.slice(1, params.fields.length).forEach(updateFunc);
            }
        }
        else {
            params.fields.forEach(updateFunc);
        }
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / menu / settings / miniChartsContainer.js View on Github external
root.append(bottomAxis);
        _this.updateColors(fills, strokes);
        return _this;
    }
    MiniStackedColumn.prototype.init = function () {
        this.scene.canvas.element.title = this.chartTranslator.translate('stackedColumnTooltip');
    };
    MiniStackedColumn.prototype.updateColors = function (fills, strokes) {
        this.bars.forEach(function (series, i) {
            series.forEach(function (bar) {
                bar.fill = fills[i];
                bar.stroke = strokes[i];
            });
        });
    };
    MiniStackedColumn.chartType = ag_grid_community_1.ChartType.StackedColumn;
    __decorate([
        ag_grid_community_1.PostConstruct,
        __metadata("design:type", Function),
        __metadata("design:paramtypes", []),
        __metadata("design:returntype", void 0)
    ], MiniStackedColumn.prototype, "init", null);
    return MiniStackedColumn;
}(MiniChart));
var MiniStackedBar = /** @class */ (function (_super) {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / chartProxies / barChartProxy.js View on Github external
BarChartProxy.isBarChart = function (type) {
        return type === ag_grid_community_1.ChartType.GroupedBar || type === ag_grid_community_1.ChartType.StackedBar || type === ag_grid_community_1.ChartType.NormalizedBar;
    };
    BarChartProxy.prototype.defaultOptions = function () {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / chartProxies / cartesian / barChartProxy.js View on Github external
BarChartProxy.isBarChart = function (type) {
        return type === ag_grid_community_1.ChartType.GroupedBar || type === ag_grid_community_1.ChartType.StackedBar || type === ag_grid_community_1.ChartType.NormalizedBar;
    };
    BarChartProxy.prototype.defaultOptions = function () {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / chartProxies / polar / doughnutChartProxy.js View on Github external
function DoughnutChartProxy(params) {
        var _this = _super.call(this, params) || this;
        _this.initChartOptions(ag_grid_community_1.ChartType.Doughnut, _this.defaultOptions());
        _this.chart = chartBuilder_1.ChartBuilder.createDoughnutChart(_this.chartOptions);
        return _this;
    }
    DoughnutChartProxy.prototype.update = function (params) {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / chartProxies / areaChartProxy.js View on Github external
labelFontStyle: undefined,
                labelFontWeight: undefined,
                labelFontSize: 12,
                labelFontFamily: 'Verdana, sans-serif',
                labelColor: this.getLabelColor(),
                itemPaddingX: 16,
                itemPaddingY: 8,
                markerPadding: 4,
                markerSize: 14,
                markerStrokeWidth: 1
            },
            seriesDefaults: {
                type: 'area',
                fills: palette.fills,
                strokes: palette.strokes,
                fillOpacity: this.chartProxyParams.chartType === ag_grid_community_1.ChartType.Area ? 0.7 : 1,
                normalizedTo: this.chartProxyParams.chartType === ag_grid_community_1.ChartType.NormalizedArea ? 100 : undefined,
                strokeWidth: 3,
                marker: true,
                markerSize: 6,
                markerStrokeWidth: 1,
                tooltipEnabled: true,
                tooltipRenderer: undefined,
                showInLegend: true,
                shadow: undefined
            }
        };
    };
    return AreaChartProxy;
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartService.js View on Github external
ChartService.prototype.chartCurrentRange = function (chartType) {
        if (chartType === void 0) { chartType = ag_grid_community_1.ChartType.GroupedColumn; }
        var selectedRange = this.getSelectedRange();
        return this.chartRange(selectedRange, chartType);
    };
    ChartService.prototype.chartCellRange = function (params) {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / gridChartComp.js View on Github external
GridChartComp.prototype.isXYChart = function () {
        return [ag_grid_community_1.ChartType.Scatter, ag_grid_community_1.ChartType.Bubble].indexOf(this.model.getChartType()) > -1;
    };
    GridChartComp.prototype.destroy = function () {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / menu / format / chartFormatingPanel.js View on Github external
ChartFormattingPanel.prototype.isBarChart = function (chartType) {
        return [
            ag_grid_community_1.ChartType.GroupedColumn,
            ag_grid_community_1.ChartType.StackedColumn,
            ag_grid_community_1.ChartType.NormalizedColumn,
            ag_grid_community_1.ChartType.GroupedBar,
            ag_grid_community_1.ChartType.StackedBar,
            ag_grid_community_1.ChartType.NormalizedBar
        ].indexOf(chartType) > -1;
    };
    ChartFormattingPanel.prototype.addComponent = function (component) {
github ag-grid / ag-grid-enterprise / dist / lib / chartAdaptor / chartComp / chartProxies / doughnutChartProxy.js View on Github external
function DoughnutChartProxy(params) {
        var _this = _super.call(this, params) || this;
        _this.chartOptions = _this.getChartOptions(ag_grid_community_1.ChartType.Doughnut, _this.defaultOptions());
        _this.chart = chartBuilder_1.ChartBuilder.createDoughnutChart(_this.chartOptions);
        return _this;
    }
    DoughnutChartProxy.prototype.update = function (params) {