KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Stacked ColumnChart #724

Open Ahmed Bucheeri opened this topic on on Mar 4, 2019 - 1 comments

Ahmed Bucheeri commented on Mar 4, 2019

Hi there

below is a result of Query, I wanted to make stacked ColumnChart categorized by Resource and Customer Duration as Stack

Array (

[0] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => Flyadeal
        [Start] => 2019-03-06 21:30:00.000
        [Finish] => 2019-03-07 01:30:00.000
        [duration] => 28
        [totalBookedHour] => 2186.5827777778
    )

[1] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => Flynas
        [Start] => 2019-03-02 05:00:00.000
        [Finish] => 2019-03-02 09:00:00.000
        [duration] => 328
        [totalBookedHour] => 2186.5827777778
    )

[2] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => GF Operation
        [Start] => 2019-03-01 08:10:00.000
        [Finish] => 2019-03-01 12:10:00.000
        [duration] => 12
        [totalBookedHour] => 2186.5827777778
    )

[3] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => Himalaya Airlines
        [Start] => 2019-03-01 00:00:00.000
        [Finish] => 2019-03-01 05:00:00.000
        [duration] => 50
        [totalBookedHour] => 2186.5827777778
    )

[4] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => Kuwait Airways
        [Start] => 2019-03-01 20:40:00.000
        [Finish] => 2019-03-02 00:40:00.000
        [duration] => 8
        [totalBookedHour] => 2186.5827777778
    )

[5] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => Nas Jet
        [Start] => 2019-03-06 00:50:00.000
        [Finish] => 2019-03-06 04:50:00.000
        [duration] => 4
        [totalBookedHour] => 2186.5827777778
    )

[6] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => Saudi Gulf Airlines 
        [Start] => 2019-03-02 00:50:00.000
        [Finish] => 2019-03-02 04:50:00.000
        [duration] => 24
        [totalBookedHour] => 2186.5827777778
    )

[7] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => SkyPrime Aviation
        [Start] => 2019-03-12 01:25:00.000
        [Finish] => 2019-03-12 04:55:00.000
        [duration] => 10
        [totalBookedHour] => 2186.5827777778
    )

[8] => Array
    (
        [Resource] => A320 SIM # 2
        [Customer] => TAP Air
        [Start] => 2019-03-01 12:20:00.000
        [Finish] => 2019-03-01 16:20:00.000
        [duration] => 199.58333333333
        [totalBookedHour] => 2186.5827777778
    )

[9] => Array
    (
        [Resource] => A320 SIM # 3
        [Customer] => Go Airlines/Airbus
        [Start] => 2019-03-01 03:00:00.000
        [Finish] => 2019-03-01 07:00:00.000
        [duration] => 620
        [totalBookedHour] => 2186.5827777778
    )

[10] => Array
    (
        [Resource] => A320 SIM # 3
        [Customer] => Maintenance
        [Start] => 2019-03-02 00:10:00.000
        [Finish] => 2019-03-02 02:10:00.000
        [duration] => 2
        [totalBookedHour] => 2186.5827777778
    )

[11] => Array
    (
        [Resource] => A320 SIM # 3
        [Customer] => Saudi Gulf Airlines 
        [Start] => 2019-02-28 22:50:00.000
        [Finish] => 2019-03-01 02:50:00.000
        [duration] => 10.833333333333
        [totalBookedHour] => 2186.5827777778
    )

[12] => Array
    (
        [Resource] => A320 SIM # 3
        [Customer] => TAP Air
        [Start] => 2019-03-31 23:10:00.000
        [Finish] => 2019-04-01 03:10:00.000
        [duration] => 0.83305555555556
        [totalBookedHour] => 2186.5827777778
    )

[13] => Array
    (
        [Resource] => A320 SIM # 4
        [Customer] => Alpha Star
        [Start] => 2019-03-12 07:20:00.000
        [Finish] => 2019-03-12 11:20:00.000
        [duration] => 24
        [totalBookedHour] => 2186.5827777778
    )

[14] => Array
    (
        [Resource] => A320 SIM # 4
        [Customer] => GF Operation
        [Start] => 2019-02-28 23:30:00.000
        [Finish] => 2019-03-01 03:30:00.000
        [duration] => 591.83305555556
        [totalBookedHour] => 2186.5827777778
    )

[15] => Array
    (
        [Resource] => A320 SIM # 4
        [Customer] => Non Corporate Users
        [Start] => 2019-03-01 03:30:00.000
        [Finish] => 2019-03-01 07:30:00.000
        [duration] => 4
        [totalBookedHour] => 2186.5827777778
    )

[16] => Array
    (
        [Resource] => A320 SIM # 4
        [Customer] => SkyPrime Aviation
        [Start] => 2019-03-15 03:40:00.000
        [Finish] => 2019-03-15 07:10:00.000
        [duration] => 23
        [totalBookedHour] => 2186.5827777778
    )

[17] => Array
    (
        [Resource] => A320 SIM # 4
        [Customer] => TAP Air
        [Start] => 2019-03-03 03:30:00.000
        [Finish] => 2019-03-03 07:30:00.000
        [duration] => 67.5
        [totalBookedHour] => 2186.5827777778
    )

[18] => Array
    (
        [Resource] => A330 SIM
        [Customer] => GF Operation
        [Start] => 2019-03-01 10:40:00.000
        [Finish] => 2019-03-01 14:40:00.000
        [duration] => 76
        [totalBookedHour] => 2186.5827777778
    )

[19] => Array
    (
        [Resource] => A330 SIM
        [Customer] => Jordan Aviation
        [Start] => 2019-03-11 06:30:00.000
        [Finish] => 2019-03-11 10:30:00.000
        [duration] => 10
        [totalBookedHour] => 2186.5827777778
    )

[20] => Array
    (
        [Resource] => A330 SIM
        [Customer] => Kuwait Airways
        [Start] => 2019-03-13 10:40:00.000
        [Finish] => 2019-03-13 14:40:00.000
        [duration] => 48
        [totalBookedHour] => 2186.5827777778
    )

[21] => Array
    (
        [Resource] => A330 SIM
        [Customer] => Onurair 
        [Start] => 2019-03-08 06:30:00.000
        [Finish] => 2019-03-08 10:30:00.000
        [duration] => 36
        [totalBookedHour] => 2186.5827777778
    )

[22] => Array
    (
        [Resource] => A330 SIM
        [Customer] => SkyPrime Aviation
        [Start] => 2019-03-23 06:00:00.000
        [Finish] => 2019-03-23 10:30:00.000
        [duration] => 9
        [totalBookedHour] => 2186.5827777778
    )

)

KoolReport commented on Mar 4, 2019

To create stacked chart you simple set is stack to true:

<?php 
ColumnChart::create(array(
    ...
    "options"=>array(
        "isStacked"=>true
    )
));
?>

Reference to Column Stacked Chart

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None