diff --git a/e107_handlers/chart_class.php b/e107_handlers/chart_class.php index f7c43b528..b7306179b 100644 --- a/e107_handlers/chart_class.php +++ b/e107_handlers/chart_class.php @@ -218,6 +218,69 @@ class e_chart return $this; } + public function renderTable() + { + + $head = array(); + $body = array(); + + foreach($this->data as $k=>$v) + { + if($k == 0) + { + foreach($v as $key=> $val) + { + $head[] = $val; + } + + continue; + } + + foreach($v as $key=> $val) + { + $body[$k][$key] = $val; + } + + } + + $text = ""; + $text .= ""; + + foreach($head as $th) + { + $text .= ""; + } + + $text .= ""; + + + + $text .= ""; + foreach($head as $th) + { + $text .= ""; + } + + $text .= ""; + + foreach($body as $tr) + { + $text .= ""; + + foreach($tr as $td) + { + $text .= ""; + } + + $text .= ""; + } + + $text .= "
".$th."
".$td."
"; + + return $text; + + } + /** * Set the type of graph * @param string $type - line | bar | pie | radar | doughnut | polar @@ -395,13 +458,17 @@ class e_chart }); + $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function (e) { + ".$fName."(); + }); + "; e107::js('footer','https://www.google.com/jsapi'); e107::js('footer-inline', $js); - return "
"; + return "
"; }