html - PHP CodeIgniter echo svg graph (SVGGraph) -
so i've begun working svggraph http://www.goat1000.com/svggraph.php.. i'm quite happy it's not playing nice inside codeigniter app.
i have function create graph. @ end can call either
$graph->render('piegraph')
or
$graph->fetch('piegraph')
ideally i'd able call function return graph echo graph wherever needed.
currently, can header/content type set "image/svg+xml" problem can't print out else in document then.
any ideas on how can svg's work inline html can insert them regular graphic.
thanks.
p.s. post code here don't have near correct. :) thanks.
i haven't tested should work you,
class test extends ci_controller { // here in method define svg graphics function get_svg() { header('content-type: image/svg+xml'); $graph = new svggraph(640, 480); $graph->colours = array('red','green','blue'); $graph->values(100, 200, 150); $graph->links('/tom/', '/dick/', '/harry/'); $graph->render('bargraph'); } // index method function index() { $this->view('test'); } } // in view page view/test.php <body> <embed type="image/svg+xml" src="<?php echo site_url('test/get_svg') ?>"; height="300" width="500"/> </body>
Comments
Post a Comment