Google Charts

Great online chart library with various chart types and functionalities

Create Beautiful Charts with PHP & MySQL

KoolReport's integration with the Google Chart library is a game-changer. With over 30 types of charts pre-wrapped, including LineChart, BarChart, and PieChart, etc.. developers can easily create visually stunning graphs without ever touching the underlying JavaScript. Simply plug your data from any sources including MySQL, excel, CSV.. into our chart-wrapped classes, and we'll handle the rest. By leveraging our framework, you can save precious time and resources while effectively communicating insights to stakeholders.

With our powerful PHP-based wrapper, even novice developers can quickly create dynamic charts that bring data to life. Check out our PHP code to see how easy it is to create the most common chart types. And if Google Charts isn't your thing, we offer other powerful visualization libraries like D3, ChartJS, and Morris Chart. Best of all, KoolReport is released under the MIT license, so you can download it for free and start visualizing your data right away. With KoolReport, the power of data visualization is now in your hands.

Get started with KoolReport and Google Charts

<?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
{
    protected function settings()
    {
        return array(
            "dataSources"=>array(
                "population2016"=>array(
                    "class"=>'\koolreport\datasources\CSVDataSource',
                    'filePath'=>dirname(__FILE__)."/../../../databases/population2016.csv",
                    "fieldSeparator"=>";"
                ),
                "data"=>array(
                    "class"=>'\koolreport\datasources\CSVDataSource',
                    "filePath"=>dirname(__FILE__)."/data.csv",
                ),
                "president"=>array(
                    "class"=>'\koolreport\datasources\ArrayDataSource',
                    "dataFormat"=>"table",
                    "data"=>[
                        ['President','Start','End'],
                        [ 'Gerald Ford',  "1974-01-20",  "1977-01-20" ],
                        [ 'Jimmy Carter',  "1977-01-20",  "1981-01-20" ],
                        [ 'Ronald Reagan',  "1981-01-20",  "1989-01-20" ],
                        [ 'George H. W. Bush',  "1989-01-20",  "1993-01-20" ],
                        [ 'Bill Clinton',  "1993-01-20",  "2001-01-20" ],
                        [ 'George W. Bush',  "2001-01-20",  "2009-01-20" ],
                        [ 'Barack Obama',  "2009-01-20",  "2017-01-20" ],
                        [ 'Donald Trump',  "2017-01-20",  date("Y-m-d") ],
                    ]
                )
            )
        );
    }

    protected function setup()
    {
        $this->src("population2016")
        ->pipe($this->dataStore("population2016"));

        $this->src("president")
        ->pipe($this->dataStore("data"));
    }
}
<div id="hidden" style="display: none">
    <div class="col-div col-md-6" style="padding: 25px"></div>
    <?php
    $chartExamples = [
        'area_chart', 'bar_chart', 'color_scheme', 'column_chart', 'combo_chart', 'donut_chart',
        'gauge_chart', 'geo_chart', 'histogram_chart', 'line_chart', 'multi_annotation', 'pareto_chart',
        'pie_chart', 'sankey', 'scatter_chart', 'stepped_area_chart', 'timeline_chart', 'treemap'
    ];
    foreach ($chartExamples as $chartExample) {
        echo "<div class='chart-example' example-name='$chartExample'>";
        include "../$chartExample/MyReport.view.php";
        echo "</div>";
    }
    ?>
</div>

<div id="display" class="repport-content">
    <div class="text-center">
        <h1>Google Charts</h1>
        <p class="lead">
            Great online chart library with various chart types and functionalities
        </p>
    </div>
    <div class="row-div row text-center"></div>
</div>

<script>
    function moveCharts() {
        var allChartDivs = [];
        var colDiv = document.querySelector(".col-div")
        var exampleDivs = document.querySelectorAll("#hidden .chart-example");
        exampleDivs.forEach(function(exampleDiv) {
            var exampleName = exampleDiv.getAttribute('example-name');
            var krwidgets = exampleDiv.querySelectorAll("#hidden krwidget");
            krwidgets.forEach(function(krwidget) {
                var colDivClone = colDiv.cloneNode();
                colDivClone.appendChild(krwidget.parentElement);
                colDivClone.innerHTML += "<h6>" + exampleName + "</h6>";
                allChartDivs.push(colDivClone);
            });
        });

        var rowDiv = document.querySelector(".row-div");
        allChartDivs.forEach(function(chartDiv) {
            rowDiv.appendChild(chartDiv);
        })
    }
    moveCharts();
    // setTimeout(moveCharts, 2000);
</script>

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