Style for Grid

The above example shows you how to create LineChart using D3 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.

The example show how to create line chart with style for grid.

For example:

<style>
.c3-xgrid-line line {
    stroke: blue;
}

.c3-xgrid-line.grid4 line {
    stroke: pink;
}

.c3-xgrid-line.grid4 text {
    fill: pink;
}

.c3-ygrid-line line {
    stroke: red;
}

.c3-ygrid-line.grid800 line {
    stroke: green;
}

.c3-ygrid-line.grid800 text {
    fill: green;
}
</style>

...
"options" => array(
    "grid" => array(
        "x" => array(
            "lines" => array(
                array(
                    "value" => 2
                ),
                array(
                    "value" => 4,
                    "class" => 'grid4',
                    "text" => 'LABEL 4'
                )
            )
        ),
        "y" => array(
            "lines" => array(
                array(
                    "value" => 500
                ),
                array(
                    "value" => 800,
                    "class" => 'grid800',
                    "text" => 'LABEL 800'
                )
            )
        )
    )
)
<?php
require_once "../../../../load.koolreport.php";
require_once "MyReport.php";
$report = new MyReport;
$report->run();
$report->render();
<?php

class MyReport extends \koolreport\KoolReport
{

}
<h1 class='title'>Style for Grid</h1>
<style>
    .c3-xgrid-line line {
        stroke: blue;
    }

    .c3-xgrid-line.grid4 line {
        stroke: pink;
    }

    .c3-xgrid-line.grid4 text {
        fill: pink;
    }

    .c3-ygrid-line line {
        stroke: red;
    }

    .c3-ygrid-line.grid800 line {
        stroke: green;
    }

    .c3-ygrid-line.grid800 text {
        fill: green;
    }
</style>
<?php
$data = [
    ['data1' =>  100],
    ['data1' =>  200],
    ['data1' => 1000],
    ['data1' =>  900],
    ['data1' =>  500],
];

\koolreport\d3\LineChart::create(array(
    "dataSource" => $data,
    "columns" => array(
        'data1',
    ),
    "options" => array(
        "grid" => array(
            "x" => array(
                "lines" => array(
                    array(
                        "value" => 2
                    ),
                    array(
                        "value" => 4,
                        "class" => 'grid4',
                        "text" => 'LABEL 4'
                    )
                )
            ),
            "y" => array(
                "lines" => array(
                    array(
                        "value" => 500
                    ),
                    array(
                        "value" => 800,
                        "class" => 'grid800',
                        "text" => 'LABEL 800'
                    )
                )
            )
        )
    )
));

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