Example #1
0
function MakeAreaChart($MyPercentSolvingsArray)
{
    $p = new chartphp();
    $p->data = array(array(array('Време', $MyPercentSolvingsArray["TimeForSolve"]), array('Оценка', $MyPercentSolvingsArray["Assessment"]), array('Мнение', $MyPercentSolvingsArray["PleasureInPercents"]), array('Дължина', $MyPercentSolvingsArray["LengthInPages"]), array('Научено', $MyPercentSolvingsArray["LearnedInPercents"]), array('Честност', $MyPercentSolvingsArray["IfCheating"])));
    $p->chart_type = "area";
    //print_r(array(array(array('Време',$MyPercentSolvingsArray["TimeForSolve"]), array('Оценка',$MyPercentSolvingsArray["Assessment"]), array('Мнение',$MyPercentSolvingsArray["PleasureInPercents"]), array('Дължина',$MyPercentSolvingsArray["LengthInPages"]), array('Научено',$MyPercentSolvingsArray["LearnedInPercents"]), array('Честност',$MyPercentSolvingsArray["IfCheating"]))));
    // Common Options
    $p->title = "Средна стойност на всички решили";
    return $p->render('c1');
}
Example #2
0
function MakeMyChart($MyFinalArray, $label, $type, $chartname)
{
    $p = new chartphp();
    $p->data = $MyFinalArray;
    $p->chart_type = $type;
    // Common Options
    $p->title = "";
    $p->ylabel = $label;
    //$p->series_label = array('Q1','Q2');
    $p->options["axes"]["yaxis"]["tickOptions"]["prefix"] = '';
    return $p->render($chartname);
}
Example #3
0
<?php

/**
 * Charts 4 PHP
 *
 * @author Shani <support@chartphp.com> - http://www.chartphp.com
 * @version 1.2.1
 * @license: see license.txt included in package
 */
include "../../lib/inc/chartphp_dist.php";
$p = new chartphp();
$p->data = array(array(array("Jan", 48.25), array("Feb", 238.75), array("Mar", 95.5), array("Apr", 300.5), array("May", 286.8), array("Jun", 400)), array(array("Jan", 300.25), array("Feb", 225.75), array("Mar", 44.5), array("Apr", 259.5), array("May", 250.8), array("Jun", 300)));
$p->chart_type = "line";
// Common Options
$p->title = "Sales - 2014 vs 2015";
$p->ylabel = "Sales";
$p->series_label = array("2014", "2015");
$p->options["axes"]["yaxis"]["tickOptions"]["prefix"] = '$';
$out = $p->render('c1');
?>
<!DOCTYPE html>
<html>
	<head>
		<script src="../../lib/js/jquery.min.js"></script>
		<script src="../../lib/js/chartphp.js"></script>
		<link rel="stylesheet" href="../../lib/js/chartphp.css">
	</head>
	<body>
		<div style="width:40%; min-width:450px;">
			<?php 
echo $out;
Example #4
0
Site: http://www.themehats.com
Purchase: http://themeforest.net/item/jango-responsive-multipurpose-html5-template/11987314?ref=themehats
Contact: support@themehats.com
Follow: http://www.twitter.com/themehats
-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
    <!--<![endif]-->
    <!-- BEGIN HEAD -->
    <link rel="stylesheet" href="php_image/lib/js/chartphp.css">
    <script src="assets/plugins/jquery.min.js" type="text/javascript"></script>
    <?php 
include "header.php";
include "php_image/lib/inc/chartphp_dist.php";
$p = new chartphp();
$p->data = array(array(array('a', 6), array('b', 8), array('c', 14), array('d', 20)));
$p->chart_type = "donut";
// Common Options
$p->title = "<p>營建預算<br><a href=\"#\" style=\"font-size:14px\">( 詳情請點我 )</a></p><p>總預算:4,332,212 <span style=\"font-size:14px\">新台幣元整</span></p>";
$out = $p->render('c1');
$p->data = array(array(array('a', 26), array('b', 18), array('c', 4), array('d', 5)));
$p->chart_type = "donut";
// Common Options
$p->title = "<p>醫療預算<br><a href=\"#\" style=\"font-size:14px\">( 詳情請點我 )</a></p><p>總預算:3,441,234 <span style=\"font-size:14px\">新台幣元整</span></p>";
$out2 = $p->render('c2');
$p->data = array(array(array('a', 48), array('b', 32), array('c', 10), array('d', 20)));
$p->chart_type = "donut";
// Common Options
$p->title = "<p>吃客松預算<br><a href=\"#\" style=\"font-size:14px\">( 詳情請點我 )</a></p><p>總預算:1,000,000 <span style=\"font-size:14px\">新台幣元整</span></p>";
$out3 = $p->render('c3');
Example #5
0
 * @license: see license.txt included in package
 */
include "../../lib/inc/chartphp_dist.php";
// Horizontal
$p = new chartphp();
$p->data = array(array(array(6, 1), array(3, 2), array(7, 3), array(5, 4), array(8, 5)), array(array(7, 1), array(5, 2), array(3, 3), array(3, 4), array(10, 5)), array(array(5, 1), array(9, 2), array(9, 3), array(8, 4), array(3, 5)));
$p->chart_type = "bar-stacked";
// Common Options
$p->title = "Horizontal Bar Stacked";
$p->xlabel = "My X Axis";
$p->ylabel = "My Y Axis";
$p->series_label = array('Q1', 'Q2', 'Q3');
$p->direction = "horizontal";
$out1 = $p->render('c1');
// Vertical
$p = new chartphp();
$p->data = array(array(array(1, 4), array(2, 6), array(3, 7), array(4, 10), array(5, 8)), array(array(1, 7), array(2, 5), array(3, 3), array(4, 2), array(5, 10)), array(array(1, 14), array(2, 9), array(3, 9), array(4, 8), array(5, 3)), array(array(1, 14), array(2, 9), array(3, 9), array(4, 8), array(5, 8)));
$p->chart_type = "bar-stacked";
// Common Options
$p->title = "Vertical Bar Stacked";
$p->xlabel = "My X Axis";
$p->ylabel = "My Y Axis";
$p->series_label = array('Q1', 'Q2', 'Q3', 'Q4');
$out2 = $p->render('c2');
?>
<!DOCTYPE html>
<html>
	<head>
		<script src="../../lib/js/jquery.min.js"></script>
		<script src="../../lib/js/chartphp.js"></script>
		<link rel="stylesheet" href="../../lib/js/chartphp.css">
            while ($row = mysqli_fetch_assoc($result5)) {
                $user_id_temp = $row["user_id"];
                $sql6 = "SELECT task_id, task_status_id FROM Task WHERE user_id = '{$user_id_temp}'";
                $result6 = mysqli_query($conn, $sql6);
                if (mysqli_num_rows($result6) > 0) {
                    while ($row = mysqli_fetch_assoc($result6)) {
                        $task_count_total++;
                    }
                }
            }
        }
    }
}
$name_team[0] = $teamName;
$team_ntasks[0] = $tasks_count;
$name_team[1] = "Mean";
$team_ntasks[1] = $task_count_total / $total_teams;
$p = new chartphp();
$arrlength = count($name_team);
// creating the arrays
for ($x = 0; $x < $arrlength; $x++) {
    $arrays[$x] = array($name_team[$x], (double) $team_ntasks[$x]);
}
$p->data = array($arrays);
// Set the arrays as the data to print the graph
$p->chart_type = "bar";
// Common Options
$p->title = "Team x Number of Tasks";
$p->xlabel = "";
$p->ylabel = "Tasks";
$outBarChartNumberTeamTasks = $p->render('c1');
Example #7
0
$out_bubble = $p->render('c3');
$p = new chartphp();
$p->title = "";
$p->intervals = array(200, 300, 400, 600);
$p->chart_type = "meter";
$p->width = "200px";
$p->height = "150px";
$p->data = array(array(rand(200, 600)));
$out_meter = $p->render('c4');
$p->data = array(array(rand(200, 600)));
$out_meter2 = $p->render('c41');
$p->data = array(array(rand(200, 600)));
$out_meter3 = $p->render('c42');
$p->data = array(array(rand(200, 600)));
$out_meter4 = $p->render('c43');
$p = new chartphp();
$p->data = array(array(array(6, 1), array(3, 2), array(7, 3), array(5, 4), array(8, 5)), array(array(7, 1), array(5, 2), array(3, 3), array(3, 4), array(10, 5)), array(array(5, 1), array(9, 2), array(9, 3), array(8, 4), array(3, 5)));
$p->chart_type = "bar-stacked";
// Common Options
$p->series_label = array('Q1', 'Q2', 'Q3');
$p->direction = "horizontal";
$out_bar_stack = $p->render('c5');
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Charts 4 PHP | Business Dashboard Demo</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
 public function Test()
 {
     $p = new \chartphp();
     $p->data = array(array(array('a', 6), array('b', 8), array('c', 14), array('d', 20)));
     $p->chart_type = "pie";
     $p->title = "";
     $out = $p->render('c2');
     return view('pages.test')->with('out', $out);
 }
            while ($row = mysqli_fetch_assoc($result5)) {
                $user_id_temp = $row["user_id"];
                $sql6 = "SELECT task_id, task_status_id FROM Task WHERE user_id = '{$user_id_temp}'";
                $result6 = mysqli_query($conn, $sql6);
                if (mysqli_num_rows($result6) > 0) {
                    while ($row = mysqli_fetch_assoc($result6)) {
                        $task_count_total++;
                    }
                }
            }
        }
    }
}
$name_team[0] = $teamName;
$team_ntasks[0] = $tasks_count;
$name_team[1] = "Mean";
$team_ntasks[1] = $task_count_total / $total_teams;
$p2 = new chartphp();
$arrlength3 = count($name_team);
// creating the arrays
for ($x = 0; $x < $arrlength3; $x++) {
    $arrays[$x] = array($name_team[$x], (double) $team_ntasks[$x]);
}
$p2->data = array($arrays);
// Set the arrays as the data to print the graph
$p2->chart_type = "bar";
// Common Options
$p2->title = "Team x Number of Tasks";
$p2->xlabel = "";
$p2->ylabel = "Tasks";
$outBarChartNumberTeamTasks = $p2->render('c2');
                $task_id_temp = $row["task_id"];
                $sql7 = "SELECT sub_task_time FROM Sub_task WHERE task_id = '{$task_id_temp}'";
                $result7 = mysqli_query($conn, $sql7);
                if (mysqli_num_rows($result7) > 0) {
                    while ($row = mysqli_fetch_assoc($result7)) {
                        $task_time_temp = $task_time_temp + $row["sub_task_time"];
                    }
                    $time_task[$counter] = $task_time_temp;
                } else {
                    $time_task[$counter] = 0;
                }
                $counter++;
            }
            //$time_task[$counter] = $task_time_temp;
        }
    }
}
$p1 = new chartphp();
$arrlength2 = count($category_name_task);
// creating the arrays
for ($x = 0; $x < $arrlength2; $x++) {
    $arrays[$x] = array($category_name_task[$x], (int) $time_task[$x]);
}
$p1->data = array($arrays);
// Set the arrays as the data to print the graph
$p1->chart_type = "bar";
// Common Options
$p1->title = "Categories x Hours";
$p1->xlabel = "";
$p1->ylabel = "Hours";
$outBarChartCateforiesxHours = $p1->render('c1');
                $task_id_temp = $row["task_id"];
                $sql7 = "SELECT sub_task_time FROM Sub_task WHERE task_id = '{$task_id_temp}'";
                $result7 = mysqli_query($conn, $sql7);
                if (mysqli_num_rows($result7) > 0) {
                    while ($row = mysqli_fetch_assoc($result7)) {
                        $task_time_temp = $task_time_temp + $row["sub_task_time"];
                    }
                    $time_task[$counter] = $task_time_temp;
                } else {
                    $time_task[$counter] = 0;
                }
                $counter++;
            }
            //$time_task[$counter] = $task_time_temp;
        }
    }
}
$p1 = new chartphp();
$arrlength = count($category_name_task);
// creating the arrays
for ($x = 0; $x < $arrlength; $x++) {
    $arrays[$x] = array($category_name_task[$x], (int) $time_task[$x]);
}
$p1->data = array($arrays);
// Set the arrays as the data to print the graph
$p1->chart_type = "bar";
// Common Options
$p1->title = "Categories x Hours";
$p1->xlabel = "";
$p1->ylabel = "Hours";
$out = $p1->render('c1');