X Axis Tick Fitting

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 x axis tick fitting.

Fit x axis ticks.

If true set, the ticks will be positioned nicely. If false set, the ticks will be positioned according to x value of the data points.

Default: true

For example:

..."options" => array(
    "axis" => array(
        "x" => array(
            "type" => 'timeseries',
            "tick" => array(
                "fit" => true,
                "format" => '%e %b %y'
            )
        )
    )
)
...
<?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'>X Axis Tick Fitting</h1>
<?php
$data = [
    ['x' => '2013-10-31', 'sample' => 30],
    ['x' => '2013-12-31', 'sample' => 100],
    ['x' => '2014-01-31', 'sample' => 400],
    ['x' => '2014-02-28', 'sample' => 150],

];

\koolreport\d3\LineChart::create(array(
    "dataSource" => $data,
    "columns" => array(
        'x',
        'sample'
    ),
    "options" => array(
        "axis" => array(
            "x" => array(
                "type" => 'timeseries',
                "tick" => array(
                    "fit" => true,
                    "format" => '%e %b %y'
                )
            )
        )
    )
));

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