Skip to content

Duration en X or X axis #89

@judzk

Description

@judzk

Hi guys,
i'm a doing stats for duration of intervention in some places at work.
in my json my time is in seconds :
[ { "tempsPerdu": "1200", "label": "B7-001" }, { "tempsPerdu": "1500", "label": "B7-002" }, { "tempsPerdu": "3000", "label": "IG-005" }, { "tempsPerdu": "300", "label": "IG-104" }, { "tempsPerdu": "2700", "label": "IG-201" }, { "tempsPerdu": "3300", "label": "IG-202" }, { "tempsPerdu": "3300", "label": "IG-205" }, { "tempsPerdu": "6000", "label": "IG-206" }, { "tempsPerdu": "21600", "label": "IG-209" }, { "tempsPerdu": "2400", "label": "IG-SS05" } ]
I can easily transform to duration ( "00:40" ). But i can't view it on a bar chart.
I tried this option, but i'm a not sure if this is good :
->optionsRaw([
'scales'=>[
'xAxes' => [
'type' => 'time',
'time' => [[
'unit' => 'hour',
'displayFormats' => [
'hour' => 'HH:mm'
]
]
]
]
]
])
Somebody can help me?
In short, i want a chart like that but with duration ( "00:40","00:20") instead of duration in seconds
image
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions