PHPackages                             heimrichhannot/contao-google-charts-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. heimrichhannot/contao-google-charts-bundle

ActiveContao-bundle

heimrichhannot/contao-google-charts-bundle
==========================================

A bundle to visualize data with google charts api

0.4.1(2y ago)0151LGPL-3.0-or-laterPHPPHP ^7.4 || ^8.0

Since Jul 2Pushed 2y agoCompare

[ Source](https://github.com/heimrichhannot/contao-google-charts-bundle)[ Packagist](https://packagist.org/packages/heimrichhannot/contao-google-charts-bundle)[ RSS](/packages/heimrichhannot-contao-google-charts-bundle/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)Dependencies (4)Versions (13)Used By (0)

Contao Google Charts Bundle
===========================

[](#contao-google-charts-bundle)

With this bundle you can visualize data with google charts api

### Description

[](#description)

This bundle uses the [cmen/google-charts-bundle](https://github.com/cmen/CMENGoogleChartsBundle) to display charts. You can use this bundle to display a chart on its own or as a config element of the [heimrichhannot/contao-reader-bundle](https://github.com/heimrichhannot/contao-reader-bundle).

### Features

[](#features)

- display data using google charts api
- optional: adds a reader config element to [heimrichhannot/contao-reader-bundle](https://github.com/heimrichhannot/contao-reader-bundle)
- optional: adds a configuration for google maps reader config element to display a elevation chart

### Documentation

[](#documentation)

#### set up chart config

[](#set-up-chart-config)

To display a chart at first you need to create a chart config. Define here which type of chart you want to use and customize attributes of the chart. You need to select a dataType as well. Currently there is `json` and `reference` to choose from. If you select `reference` as dataType you need to set the dataContainer and the dataField which holds the referenced data. You can also set a specific entity to get the data from. This is optional. If you do not set an entity it is set when you use the chart as a reader config element. Otherwise you could set it by an event listener. If the entity is never set, you will get an error.

If you are done creating the chart config there are several ways to display the chart.

#### display chart by module

[](#display-chart-by-module)

The simplest way to display the chart is to create a module that uses the chart configuration to show the chart in frontend.

#### display chart by reader config element

[](#display-chart-by-reader-config-element)

You can use the chart as reader config element in [heimrichhannot/contao-reader-bundle](https://github.com/heimrichhannot/contao-reader-bundle). If you have set the dataType to `reference` in the chart configuration the entity will be set automatically by the current item id.

### DataTypes

[](#datatypes)

When data is added to the chart it has to be of type array.

#### JSON

[](#json)

Enter valid json that contains pairs of x-/y-values. Please do not enter the labels for the axis in this json but rather use the input fields labelX and labelY.

```
[
    ['value-x', 'value-y'],
    ['value-x', 'value-y'],
    ['value-x', 'value-y']
    ...
]

```

#### Reference

[](#reference)

To use data that is provided by a certain entity you can use the reference dataType. In the chart config set the dataContainer and dataField which holds the data. Optional you can set the specific entity from which you want to retrieve the data. If you use the chart config for a reader config element the entity will be set automatically when the config element of the item is generated.

#### how to modify the chart data

[](#how-to-modify-the-chart-data)

IMPORTANT: When you want to add data to the chart keep in mind that this data HAS TO BE AN ARRAY. You can modify the data in two different ways.

##### DataType

[](#datatype)

You can add a custom dataType which will be selectable in chart config. Here data is configured and added to the dataType by the `setData` method. For example for dataType `reference` the data is pulled here from the referenced entity which is selected by the values (dataContainer, dataField, dataEntity) you've set in the chart configuration.

DataTypes are added as services. Add the '\_instanceof' part to your service.yml and add your dataType class like in this example.

```
services:
  _instanceof:
      HeimrichHannot\GoogleChartsBundle\DataType\DataTypeInterface:
        tags: ['huh.google_charts.data_type']

# DataTypes

  HeimrichHannot\GoogleChartsBundle\DataType\Concrete\DataTypeJson: ~
  HeimrichHannot\GoogleChartsBundle\DataType\Concrete\DataTypeReference: ~

```

##### GoogleChartsModifyChartDataEvent

[](#googlechartsmodifychartdataevent)

Independant from the dataType you've chosen you can modify the chart data by this event. The event holds the chart config and the data that was set by the dataType as parameters. To modify the data you need to set the data in the event using the `setData` method

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~143 days

Recently: every ~349 days

Total

11

Last Release

1076d ago

PHP version history (4 changes)0.1.0PHP ^7.1

0.3.3PHP ^7.1||^8.0

0.4.0PHP ^7.1 || ^8.0

0.4.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/28ad3224d8727b622ebd229840eea6b9dbcb83eb0bd609e6ce65b614830ff538?d=identicon)[digitales@heimrich-hannot.de](/maintainers/digitales@heimrich-hannot.de)

---

Top Contributors

[![koertho](https://avatars.githubusercontent.com/u/12064642?v=4)](https://github.com/koertho "koertho (4 commits)")[![matuweb](https://avatars.githubusercontent.com/u/13745042?v=4)](https://github.com/matuweb "matuweb (3 commits)")[![mirkogleibe](https://avatars.githubusercontent.com/u/850300?v=4)](https://github.com/mirkogleibe "mirkogleibe (3 commits)")

### Embed Badge

![Health badge](/badges/heimrichhannot-contao-google-charts-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/heimrichhannot-contao-google-charts-bundle/health.svg)](https://phpackages.com/packages/heimrichhannot-contao-google-charts-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[shopware/storefront

Storefront for Shopware

684.2M148](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[contao-community-alliance/dc-general

Universal data container for Contao

1578.3k86](/packages/contao-community-alliance-dc-general)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
