You are here

function FrxSVGGraph::generateCrossTab in Forena Reports 7.4

Generate a crosstab table.

Parameters

unknown $xml:

unknown $config:

unknown $div:

unknown $group:

unknown $dim:

1 call to FrxSVGGraph::generateCrossTab()
FrxSVGGraph::generate in renderers/FrxSVGGraph.inc
Generate the template from the configuration.

File

renderers/FrxSVGGraph.inc, line 725

Class

FrxSVGGraph

Code

function generateCrossTab($xml, &$config, &$div, $group, $dim) {
  $attrs = array();
  $table_frx['renderer'] = 'FrxCrosstab';
  $table_frx['group'] = is_array($group) ? implode(' ', $group) : $group;
  $table_frx['dim'] = $dim;
  $table = $this
    ->setFirstNode($div, 4, 'table', NULL, $attrs, $table_frx);
  $thead = $this
    ->setFirstNode($table, 6, 'thead');
  $throw = $this
    ->setFirstNode($thead, 8, 'tr');
  $tbody = $this
    ->setFirstNode($table, 6, 'tbody');
  $tdrow = $this
    ->setFirstNode($tbody, 8, 'tr', NULL, NULL, $attrs);
  if ($config['crosstab_columns']) {
    foreach ($config['crosstab_columns'] as $key => $col) {
      if ($col['type'] !== 'ignore') {
        if ($col['type'] == 'heading') {
          $tag = 'th';
        }
        else {
          $tag = 'td';
        }
        if ($col['type'] != 'crosstab') {
          $this
            ->addNode($throw, 10, $tag, $col['label']);
          $this
            ->addNode($tdrow, 10, $tag, $col['contents']);
        }
      }
    }
  }
}