You are here

function _charts_examples_pie_alternative_syntax in Charts 7.2

File

includes/charts.examples.inc, line 77

Code

function _charts_examples_pie_alternative_syntax() {
  $chart = array(
    '#type' => 'chart',
    '#title' => t('Pie alternative syntax'),
    '#chart_type' => 'pie',
    '#chart_library' => 'highcharts',
    '#legend_position' => 'right',
    '#data_labels' => TRUE,
    '#tooltips' => FALSE,
  );
  $chart['pie_data'] = array(
    '#type' => 'chart_data',
    '#title' => t('Gender'),
    '#data' => array(
      array(
        'Male',
        10,
      ),
      array(
        'Female',
        20,
      ),
    ),
  );
  $example['chart'] = $chart;
  return $example;
}