Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duration en X or X axis #89

Open
judzk opened this issue Feb 27, 2020 · 0 comments
Open

Duration en X or X axis #89

judzk opened this issue Feb 27, 2020 · 0 comments

Comments

@judzk
Copy link

judzk commented Feb 27, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant