Render() public method

Pass in the type of graph to display
public Render ( $class, $header = TRUE, $content_type = TRUE, $defer_js = FALSE )
Beispiel #1
0
 protected function renderGraph($graphType, $width, $height, $settings, $values, $destFile = null)
 {
     $graph = new \SVGGraph($width, $height, $settings);
     $graph->Values($values);
     if ($destFile) {
         ob_start();
     }
     $graph->Render($graphType, false, false);
     if ($destFile) {
         file_put_contents($destFile, ob_get_clean());
     }
 }
Beispiel #2
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
$settings = array('back_colour' => 'white', 'graph_title' => 'Start of Fibonacci series');
$graph = new SVGGraph(600, 450, $settings);
$graph->Values(0, 1, 1, 2, 3, 5, 8, 13, 21);
$graph->Render('BarGraph');