Skip to content
Advertisement

Chart.js timeline [Group for single bar]

I would like to create a time line like this: [1]: https://i.stack.imgur.com/RQ819.png

But I don’t understand how to put green into the top bar and yellow into the bottom bar.

This is what I got so far but I don’t find anything how to make group only for one bar.

JavaScript
JavaScript

Advertisement

Answer

You need to define a separate datasets for each floating bar.

Please take a look at your amended code and see how it works.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement