# Multiple charts one notebook

**URL:** <https://talk.observablehq.com/t/multiple-charts-one-notebook/2844>\
**Category:** Help\
**Created:** [February 17, 2020, 3:58pm UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844 "2020-02-17T15:58:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuwilmur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/stuwilmur/32/3074_2.png) [@stuwilmur](https://talk.observablehq.com/u/stuwilmur)\
**Post date:** [February 17, 2020, 3:58pm UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844/1 "2020-02-17T15:58:26Z")

</div>

I’ve been tinkering with the great example of the Gapminder style plots by forking  
[this notebook](https://observablehq.com/@mbostock/the-wealth-health-of-nations). I’d like to be able to plot two charts side by side to show different variables on another chart (as a concrete example, show income vs population) however I’m struggling as something of a novice to see how to implement this and keep it DRY. Any suggestions welcome.

---

<div class="post-metadata">

**Author:** ![mbostock](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mbostock/32/9_2.png) [@mbostock](https://talk.observablehq.com/u/mbostock)\
**Post date:** [February 17, 2020, 4:26pm UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844/2 "2020-02-17T16:26:56Z")

</div>

You can use multiple import-with statements to import this chart into your notebook and override the data (or any other cell definition):

> **[Introduction to Imports](https://observablehq.com/@observablehq/introduction-to-imports)**
>
> An Observable notebook by Observable.

Alternatively, you could fork my notebook to wrap the chart cell in a function that you can then call to instantiate the chart with different settings and data.

---

<div class="post-metadata">

**Author:** ![stuwilmur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/stuwilmur/32/3074_2.png) [@stuwilmur](https://talk.observablehq.com/u/stuwilmur)\
**Post date:** [February 17, 2020, 4:36pm UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844/3 "2020-02-17T16:36:27Z")

</div>

Many thanks Mike I will try both those approaches and see how I get on.

---

<div class="post-metadata">

**Author:** ![zanarmstrong](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/zanarmstrong/32/6029_2.png) [@zanarmstrong](https://talk.observablehq.com/u/zanarmstrong)\
**Post date:** [February 20, 2021, 6:05am UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844/4 "2021-02-20T06:05:06Z")

</div>

stuwilmur - did you end up implementing this? I have a similar goal and would be nice to learn from your experience. Thank you!

---

<div class="post-metadata">

**Author:** ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)\
**Post date:** [February 20, 2021, 12:07pm UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844/5 "2021-02-20T12:07:29Z")

</div>

@zanarmstrong Can you describe what you’re attempting to do, or ideally share a notebook link?

---

<div class="post-metadata">

**Author:** ![stuwilmur](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/stuwilmur/32/3074_2.png) [@stuwilmur](https://talk.observablehq.com/u/stuwilmur)\
**Post date:** [October 1, 2022, 3:28pm UTC](https://talk.observablehq.com/t/multiple-charts-one-notebook/2844/6 "2022-10-01T15:28:09Z")

</div>

@zanarmstrong, sorry for the very delayed reply! I did, thanks to Mike’s help. Please see [https://observablehq.com/d/60dcb7fff1532121](https://observablehq.com/d/60dcb7fff1532121). Perhaps it will be helpful.
