Timeline chart with horizontal bars with combinations

607 views
Skip to first unread message

Andreas Thyholdt

unread,
Mar 9, 2016, 2:05:12 PM3/9/16
to vega-js
Hello.

I am looking to create a timeline chart such as this D3 implementation: http://bl.ocks.org/bunkat/2338034
Is this possible in Vega?

Additionally, I am interested in any good source on how to make combination charts in Vega. Say I wanted to do the above and also have a couple of line plots below on a separate axis, but in the same chart. Then maybe some point plots above it all.

Something like the mockup attached.

Thank you.

Graf mockup adems.jpg

Roy I

unread,
Mar 9, 2016, 5:40:06 PM3/9/16
to vega-js
Andreas, All that can be done in Vega. Take a look at these examples:

Vega examples:

The current version of Vega will not show lines in the built-in "legend". But you can just draw what you want at any location.

Vega-lite is much easier to use for simple charts. It can generate Vega specs (JSON format) that you can re-use sections as starting point to build your customized Vega spec. 

Vega-lite: 

Vega-lite examples:

Andreas Thyholdt

unread,
Mar 10, 2016, 3:00:50 AM3/10/16
to vega-js
Thanks a lot for your time and examples, Roy.
They are interesting, but hard to apply to my current need as a newcomer to D3/Vega.

I have prepared a sample JSON file, which shows the kind of data that comes from the database. There is also a more detailed explanation of the requirements in a comment in the file.
Is it possible to make a recommendation on what approach to use, based on this data?
Thanks again.

JSON graphspec.txt
Reply all
Reply to author
Forward
0 new messages