twwwt
twwwt

Reputation: 502

Vega: How to display multiple charts in the same view

I want to display more than one Vega chart in the same view, aligned either horizontally or vertically; i.e., have them grid-like aligned either side by side in the same row or below each other in multiple rows.

Vega-lite supports this directly using the hconcat and vconcat operator, respectively. But how would you do that in Vega? I couldn't find equivalent operators in Vega, but I guess it should be possible in a more low-level way. Any best-practices on how to achieve that?

Upvotes: 0

Views: 1030

Answers (1)

twwwt
twwwt

Reputation: 502

It can be done based on Vega's layout abstraction and group marks.

A basic example for a one-column vertical alignment of two charts can be found here. Similarly, a one-row horizontal alignment of three charts can be found in this example.

Upvotes: 1

Related Questions