ScatterChart

This example shows how to create beautiful ScatterChart

The above example shows you how to create ScatterChart using ApexCharts package. 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.

<?php

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

$report = new MyReport;
$report->run()->render();
<?php

class MyReport extends \koolreport\KoolReport
{

}
<div class="report-content">
    <div class="text-center">
        <h1>ScatterChart</h1>
        <p class="lead">
            This example shows how to create beautiful ScatterChart
        </p>
    </div>
    <style>
        .apexcharts-canvas {
            margin: 0 auto;
        }
    </style>
    <div style="margin-bottom:50px;">
        <?php
        $data = [
            [
                'Team1_x',
                'Team1_y',
                'Team2_x',
                'Team2_y',
                'Team3_x',
                'Team3_y',
                'Team4_x',
                'Team4_y',
                'Team5_x',
                'Team5_y',
            ],
            [
                "2017-2-11",
                10,
                "2017-2-11",
                37,
                "2017-2-11",
                29,
                "2017-2-11",
                11,
                "2017-2-11",
                49
            ],
            [
                "2017-2-12",
                36,
                "2017-2-12",
                53,
                "2017-2-12",
                23,
                "2017-2-12",
                16,
                "2017-2-12",
                23
            ],
            [
                "2017-2-13",
                47,
                "2017-2-13",
                47,
                "2017-2-13",
                27,
                "2017-2-13",
                42,
                "2017-2-13",
                43
            ],
            [
                "2017-2-14",
                23,
                "2017-2-14",
                13,
                "2017-2-14",
                42,
                "2017-2-14",
                29,
                "2017-2-14",
                56
            ],
            [
                "2017-2-15",
                29,
                "2017-2-15",
                37,
                "2017-2-15",
                28,
                "2017-2-15",
                22,
                "2017-2-15",
                33
            ],
            [
                "2017-2-16",
                20,
                "2017-2-16",
                16,
                "2017-2-16",
                12,
                "2017-2-16",
                35,
                "2017-2-16",
                32
            ],
            [
                "2017-2-17",
                59,
                "2017-2-17",
                53,
                "2017-2-17",
                36,
                "2017-2-17",
                36,
                "2017-2-17",
                56
            ],
            [
                "2017-2-18",
                36,
                "2017-2-18",
                33,
                "2017-2-18",
                18,
                "2017-2-18",
                15,
                "2017-2-18",
                33
            ],
            [
                "2017-2-19",
                37,
                "2017-2-19",
                34,
                "2017-2-19",
                33,
                "2017-2-19",
                60,
                "2017-2-19",
                59
            ],
            [
                "2017-2-20",
                23,
                "2017-2-20",
                32,
                "2017-2-20",
                26,
                "2017-2-20",
                27,
                "2017-2-20",
                26
            ],
            [
                "2017-2-21",
                15,
                "2017-2-21",
                21,
                "2017-2-21",
                19,
                null,
                null,
                "2017-2-21",
                50
            ],
            [
                "2017-2-22",
                51,
                "2017-2-22",
                10,
                "2017-2-22",
                13,
                null,
                null,
                "2017-2-22",
                54
            ],
            [
                "2017-2-23",
                55,
                "2017-2-23",
                11,
                "2017-2-23",
                60,
                null,
                null,
                "2017-2-23",
                47
            ],
            [
                "2017-2-24",
                33,
                "2017-2-24",
                60,
                "2017-2-24",
                37,
                null,
                null,
                "2017-2-24",
                38
            ],
            [
                "2017-2-25",
                22,
                "2017-2-25",
                56,
                "2017-2-25",
                14,
                null,
                null,
                "2017-2-25",
                52
            ],
            [
                "2017-2-26",
                22,
                "2017-2-26",
                50,
                "2017-2-26",
                60,
                null,
                null,
                "2017-2-26",
                37
            ],
            [
                "2017-2-27",
                19,
                "2017-2-27",
                39,
                "2017-2-27",
                32,
                null,
                null,
                "2017-2-27",
                25
            ],
            [
                "2017-2-28",
                26,
                "2017-2-28",
                49,
                "2017-2-28",
                45,
                null,
                null,
                "2017-2-28",
                27
            ],
            [
                "2017-3-1",
                15,
                "2017-3-1",
                41,
                "2017-3-1",
                19,
                null,
                null,
                "2017-3-1",
                25
            ],
            [
                "2017-3-2",
                51,
                "2017-3-2",
                27,
                "2017-3-2",
                37,
                null,
                null,
                "2017-3-2",
                32
            ]
        ];
        \koolreport\apexcharts\ScatterChart::create(array(
            // "title" => "Traffic Sources",
            "dataSource" => $data,
            "columns" => array(
                'TEAM 1' => [
                    'combination' => [
                        'Team1_x',
                        'Team1_y',
                    ]
                ],
                'TEAM 2' => [
                    'combination' => [
                        'Team2_x',
                        'Team2_y',
                    ]
                ],
                'TEAM 3' => [
                    'combination' => [
                        'Team3_x',
                        'Team3_y',
                    ]
                ],
                'TEAM 4' => [
                    'combination' => [
                        'Team4_x',
                        'Team4_y',
                    ]
                ],
                'TEAM 5' => [
                    'combination' => [
                        'Team5_x',
                        'Team5_y',
                    ]
                ],
            ),
            "options" => [
                'chart | zoom | type' => 'xy',
                'grid' => [
                    'xaxis | lines | show' => true,
                    'yaxis | lines | show' => true,
                ],
                'xaxis | type' => 'datetime',
                'yaxis | max' => 70,
            ],
            // "showLegend" => false,
            // "showLabel" => true,
            // "height" => "600px",
            // "width" => "85%",
            "maxWidth" => "800px",
        ));
        ?>
    </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