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”
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 );
Nothing…
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 ?
Tanks.
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!
Hello,
In pie chart I want to show rows even if the value is 0, how to do that in Bundle?
Thanks you
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…
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.
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 );
Nothing…
$dataTable->addColumn(‘id1’, ‘label 1’, ‘string’, ‘hAxis: {minValue: 0}’);
Nothing…
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 ?
Tanks.
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!
Hello,
In pie chart I want to show rows even if the value is 0, how to do that in Bundle?
Thanks you
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) }}
ˋ`ˋ
(Source: http://stackoverflow.com/questions/10422141/display-item-in-legend-even-if-value-0-with-google-charts-tools-pie-chart)
Hi,
I am using your g-chart bundle.
I want to customize tool tip in column chart, how can I achieve this?
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 (optionalrole
param). If not, I’ll give it a try… Please let me know.Thanks,
Saad