TimeLineChart

This example shows how to create beautiful TimeLineChart

positionnamedate_startdate_end
President George Washington 1789/4/30 1797/3/4
President John Adams 1797/3/4 1801/3/4
Vice President John Adams 1789/4/21 1797/3/4
President Thomas Jefferson 1801/3/4 1809/3/4
Vice President Thomas Jefferson 1797/3/4 1801/3/4
Secretary of State Thomas Jefferson 1790/3/22 1793/12/31
Vice President Aaron Burr 1801/3/4 1805/3/4
Vice President George Clinton 1805/3/4 1812/4/20
Secretary of State John Jay 1789/9/25 1790/3/22
Secretary of State Edmund Randolph 1794/1/2 1795/8/20
Secretary of State Timothy Pickering 1795/8/20 1800/5/12
Secretary of State Charles Lee 1800/5/13 1800/6/5
Secretary of State John Marshall 1800/6/13 1801/3/4
Secretary of State Levi Lincoln 1801/3/5 1801/5/1
Secretary of State James Madison 1801/5/2 1809/3/3

$data2 = \koolreport\apexcharts\Chart::rowsToColumns($data, [
    'rowColumns' => ['name'],
    'valueColumns' => ['date_start', 'date_end'],
    'fixedColumns' => ['position']
]);
positionGeorge Washington__date_startGeorge Washington__date_endJohn Adams__date_startJohn Adams__date_endThomas Jefferson__date_startThomas Jefferson__date_endAaron Burr__date_startAaron Burr__date_endGeorge Clinton__date_startGeorge Clinton__date_endJohn Jay__date_startJohn Jay__date_endEdmund Randolph__date_startEdmund Randolph__date_endTimothy Pickering__date_startTimothy Pickering__date_endCharles Lee__date_startCharles Lee__date_endJohn Marshall__date_startJohn Marshall__date_endLevi Lincoln__date_startLevi Lincoln__date_endJames Madison__date_startJames Madison__date_end
President 1789/4/30 1797/3/4 1797/3/4 1801/3/4 1801/3/4 1809/3/4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Vice President 0 0 1789/4/21 1797/3/4 1797/3/4 1801/3/4 1801/3/4 1805/3/4 1805/3/4 1812/4/20 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Secretary of State 0 0 0 0 1790/3/22 1793/12/31 0 0 0 0 1789/9/25 1790/3/22 1794/1/2 1795/8/20 1795/8/20 1800/5/12 1800/5/13 1800/6/5 1800/6/13 1801/3/4 1801/3/5 1801/5/1 1801/5/2 1809/3/3

\koolreport\apexcharts\TimeLineChart::create(array(
    "dataSource" => $data2,
    "columns" => [
        'position',
        'George Washington' => [
            'combination' => [
                'George Washington__date_start',
                'George Washington__date_end'
            ]
        ],
        'Thomas Jefferson' => [
            'combination' => [
                'Thomas Jefferson__date_start',
                'Thomas Jefferson__date_end'
            ]
        ],
        'John Adams' => [
            'combination' => [
                'John Adams__date_start',
                'John Adams__date_end'
            ]
        ],
        ...
    ]
));
Description