Search code examples
pandasaltair

How to stack charts in Altair


I have a series of charts that I want to put together in Altair to create a dashboard.

The first is national stats Top left. Let's call it top_left

enter image description here

The second is at regional level. I want this beneath the first - there are going to be two more panels but I'll work on them later.

enter image description here

I'll call that bottom_left.

I've learned that the

top_left & bottom_left 

should lead to one on top of the other in Altair.

But I get the error:

ValueError: Objects with "config" attribute cannot be used within VConcatChart. Consider defining the config attribute in the VConcatChart object instead.

What does this mean and how do I solve it?


Solution

  • Pretty sure this post should answer your question.

    You did not provide any code for the two example charts but it seems at least one of them uses one of the "config_*" methods. So what you have to do is remove that config from the chart, combine/arrange your charts and then do the config on that combined chart object.