Demo GChartBundle


You you need help or want to report a bug, please use Github issues.

QR Code Demo

Visualization Chart Demo

Simple Chart Demo

6 thoughts on “Demo GChartBundle

  1. Hello,

    i need to add some option like:
    hAxis: {minValue: 0}
    I try to put it in:
    $p = array(‘p’=>’hAxis: {minValue: 0}’);
    $dataTable = new DataTable\DataTable( $p );

    $dataTable->addColumn(‘id1’, ‘label 1’, ‘string’, ‘hAxis: {minValue: 0}’);

    And in the twig:
    {{ gchart_bar_chart(dataTable, ‘chart4’, 600, 200, ‘Durée des licenses’, ‘hAxis: {minValue: 0}’) }}

    But nothing…

    Is it possible to use options ?


  2. Hi,
    Thanks for using GChart. Here is an example of using the hAxis option with linechart:

    {{ gchart_line_chart(dataTable2, 'chart3', 400, 200, 'coucou',{'hAxis': {'title': 'Hello', 'titleTextStyle': {'color': '#FF0000'}}}) }}

    so as you can see, options can be passed as an associative array to almost all twig functions. I hope it helps!

  3. Hello,

    In pie chart I want to show rows even if the value is 0, how to do that in Bundle?
    Thanks you

  4. Hi,
    Did you try to use the `sliceVisibilityThreshold` option when creating the Piechart instance?

    // this code was written on a smart phone and was not tested…

    // in controller
    $this->render(‘template’, array(dataTable => …, ‘options’ => array(sliceVisibilityThreshold => 0)));

    // in Twig
    {{ gchart_pie_chart(dataTable, ‘chart1’, 400, 200, ‘title’, options) }}


  5. Hi Ajay,

    According to Google Chart documentation on Tooltips, you need to have add a column:

    // in js
    dataTable.addColumn({type: 'string', role: 'tooltip'});

    Unfortunately, the PHP class DataColumn does not handle role attributes.

    Can you please open a github ticket here?

    Please feel free to open a PR if you feel comfortable adding that property to DataColumn class (DataTable::addColumn($id, $label, $type) would have to be updated too (optional role param). If not, I’ll give it a try… Please let me know.



Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *