# How to make an x axis sticky on a D3 chart?

**URL:** <https://talk.observablehq.com/t/how-to-make-an-x-axis-sticky-on-a-d3-chart/6177>\
**Category:** Help\
**Created:** [February 7, 2022, 5:53pm UTC](https://talk.observablehq.com/t/how-to-make-an-x-axis-sticky-on-a-d3-chart/6177 "2022-02-07T17:53:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![shancarter](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/shancarter/32/3471_2.png) [@shancarter](https://talk.observablehq.com/u/shancarter)\
**Post date:** [February 7, 2022, 9:09pm UTC](https://talk.observablehq.com/t/how-to-make-an-x-axis-sticky-on-a-d3-chart/6177/2 "2022-02-07T21:09:24Z")

</div>

You would need to put the x-axis in a different html element, and then use the technique in this notebook: [Sticky Positioning / Fabian Iwand | Observable](https://observablehq.com/@mootari/sticky-positioning)

There is some discussion in this post as well:

> [@Sticky sidebar in cell](https://talk.observablehq.com/t/sticky-sidebar-in-cell/2268):
>
> I was trying to have a sticky sidebar inside a cell, that is a sidebar that sticks to the top of either the viewport or cell and stops at the bottom of the cell - like [here](https://abouolia.github.io/sticky-sidebar/examples/basic.html), just for a cell. I tried all sort of CSS things (e.g. position sticky) and sticky sidebar npm and jquery modules, but failed. [Here’s](https://observablehq.com/@kappelmann/sticky-sidebar) a small template. Any help appreciated.

Hope that helps!

---

_[View the full topic](https://talk.observablehq.com/t/how-to-make-an-x-axis-sticky-on-a-d3-chart/6177)._
