It appears as though the Google Charts Integration does not accept pieHole property of pie chart.

Comments

Nchase’s picture

I haven't seen any option in views that would allow the pieHole setting...

samuel.seide’s picture

There isn't an option out of the box that allows for pieHole to be used, but I got it working by writing a custom module. The module takes the block name and if it is named with a '__donut' at the end of the name it changes it to a pieHole chart. This also adds in the options for a 3d chart, a stacked chart, and a curved line chart.

<?php

function YOURMODULENAME_chart_alter(&$chart, $chart_id) {

  $array1 = array();

  $piehole = '__donut';
  $threed = '__3d';
  $stacked = '__stacked';
  $curvedlines = '__curved';

  $pieholecheck = strpos($chart_id, $piehole);
  $threed = strpos($chart_id, $threed);
  $stackedcheck = strpos($chart_id, $stacked);
  $curvedlinescheck = strpos($chart_id, $curvedlines);

  if ($curvedlinescheck !== false) { //checks if the chart id has __curvedlines added to the machine name
    $array1 = array('curveType' => 'function');
  }
  elseif ($stackedcheck !== false) { //checks if the chart id has __stacked added to the machine name
    $array1 = array('isStacked' => 'TRUE');
  }
  elseif ($threed !== false) { //checks if the chart id has __threed added to the machine name
    $array1 = array('is3D' => 'TRUE');
  }
  elseif ($pieholecheck !== false) { //checks if the chart id has __piehole added to the machine name
    $array1 = array('pieHole' => '.4');
  }

  $array2 = array(
  'chartArea' => array('width' => "60%", 'height' => "55%", 'left' => 100),
  'legend' => array('alignment' => 'center', 'maxLines' => 10, 'textStyle' => array('fontSize' => 10)),
  'hAxis' => array('maxTextLines' => 5)
  );

  $chart['#raw_options'] = $array1 + $array2;

}
Pierre.Vriens’s picture

Category: Bug report » Support request