protected function getSparkline($metric)
    {
        // sparkline is always echoed, so we need to buffer the output
        $view = $this->getRowEvolutionGraph($graphType = 'sparkline', $metrics = array($metric => $metric));

        ob_start();
        $view->render();
        $spark = ob_get_contents();
        ob_end_clean();

        // undo header change by sparkline renderer
        Common::sendHeader('Content-type: text/html');

        // base64 encode the image and put it in an img tag
        $spark = base64_encode($spark);
        return '<img width="100" height="25" src="data:image/png;base64,' . $spark . '" />';
    }
protected function getSparkline($metric)
    {
        // sparkline is always echoed, so we need to buffer the output
        $view = $this->getRowEvolutionGraph($graphType = 'sparkline', $metrics = array($metric => $metric));

        ob_start();
        $view->render();
        $spark = ob_get_contents();
        ob_end_clean();

        // undo header change by sparkline renderer
        Common::sendHeader('Content-type: text/html');

        // base64 encode the image and put it in an img tag
        $spark = base64_encode($spark);
        return '<img width="100" height="25" src="data:image/png;base64,' . $spark . '" />';
    }
protected function getSparkline ( $ metric ) { // sparkline is always echoed, so we need to buffer the output $ view = $ this -> getRowEvolutionGraph ( $ graphType = 'sparkline' , $ metrics = array ( $ metric => $ metric ) ) ; ob_start ( ) ; $ view -> render ( ) ; $ spark = ob_get_contents ( ) ; ob_end_clean ( ) ; // undo header change by sparkline renderer Common :: sendHeader ( 'Content-type: text/html' ) ; // base64 encode the image and put it in an img tag $ spark = base64_encode ( $ spark ) ; return '<img width="100" height="25" src="data:image/png;base64,' . $ spark . '" />' ; }
Get the img tag for a sparkline showing a single metric
Get the img tag for a sparkline showing a single metric