Linear trendlines

The above example shows you how to create ScatterChart using built-in Google Charts. In this example, for purpose of chart demonstration only, we do use mock-up data from array. As you can see, the KoolReport's widget in general support dataSource could be DataStore, Process, DataSource or even simple array.

For example:

...
"options" => array(
            ...
            "trendlines" => array(
                0 => array()
            )
        )
<?php

require_once "../../../../load.koolreport.php";
require_once "MyReport.php";

$report = new MyReport;
$report->run()->render();
<?php
require_once "../../../../load.koolreport.php";
class MyReport extends \koolreport\KoolReport
{

}
<?php

use \koolreport\widgets\google\ScatterChart;

$height_weight_smokers = array(
    array("height", "weight", "smokers"),
    array(170, 82, 123),
    array(180, 91, 45),
    array(150, 60, 14),
    array(152, 55, 55),
    array(168, 65, 223),
    array(178, 67, 55),
    array(185, 46, 223),
    array(166, 77, 55),
    array(153, 50, 77),
    array(166, 44, 155),
);


$data2 = [
    ['Diameter', 'Age'],
    [8, 37],
    [4, 19.5],
    [11, 52],
    [4, 22],
    [3, 16.5],
    [6.5, 32.8],
    [14, 72]
]

?>
<div class="report-content">
    <div class="text-center">
        <h1>Linear trendlines
        </h1>
    </div>
    <div style="margin-bottom:50px;">
        <?php
        ScatterChart::create(array(
            "title" => 'Linear trendlines',
            "dataSource" => $data2,
            "columns" => array(
                'Diameter',
                'Age'
            ),
            "options" => array(
                "hAxis" => array(
                    "title" => "Diameter"
                ),
                "vAxis" => array(
                    "title" => "Age"
                ),
                "legend" => 'none',
                "trendlines" => array(
                    0 => array()
                )
            )
        ));
        ?>
    </div>

</div>

What People Are Saying

"KoolReport helps me very much in creating data report for my corporate! Keep up your good work!"
-- Alain Melsens

"The first use of your product. I was impressed by its easiness and powerfulness. This product is a great and amazing."
-- Dr. Lew Choy Onn

"Fantastic framework for reporting!"
-- Greg Schneider

Download KoolReport Get KoolReport Pro