You are here

function FrxSVGGraph::renderChart in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 plugins/FrxSVGGraph.inc \FrxSVGGraph::renderChart()
  2. 7.2 plugins/FrxSVGGraph.inc \FrxSVGGraph::renderChart()
  3. 7.3 renderers/FrxSVGGraph.inc \FrxSVGGraph::renderChart()
1 call to FrxSVGGraph::renderChart()
FrxSVGGraph::render in renderers/FrxSVGGraph.inc
Render the graph.

File

renderers/FrxSVGGraph.inc, line 412

Class

FrxSVGGraph

Code

function renderChart($type) {
  $type = strtolower($type);

  // Legacy sustitions for backcward compatibility.
  if ($type == 'piechart') {
    $type = 'piegraph';
  }
  if ($type == 'scatterplot') {
    $type = 'scattergraph';
  }
  if ($type == 'multiscatterplot') {
    $type = 'multiscattergraph';
  }

  // Newly defined types
  $graph_types = FrxSVGGraph::graphTypes();

  // Build map for array types.
  $lower_graphs_types = array_change_key_case($graph_types);
  $graph_classes = array_combine(array_keys($lower_graphs_types), array_keys($graph_types));
  if (isset($graph_classes[$type])) {
    $class = $graph_classes[$type];
    $output = $this
      ->renderGraph($class);
  }
  return $output;
}