# How to remove left and right margins from bar chart or else modify the x-axis label location

**URL:** <https://talk.observablehq.com/t/how-to-remove-left-and-right-margins-from-bar-chart-or-else-modify-the-x-axis-label-location/8643>\
**Category:** Help\
**Created:** [December 22, 2023, 9:00pm UTC](https://talk.observablehq.com/t/how-to-remove-left-and-right-margins-from-bar-chart-or-else-modify-the-x-axis-label-location/8643 "2023-12-22T21:00:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![miketalley](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/miketalley/32/8381_2.png) [@miketalley](https://talk.observablehq.com/u/miketalley)\
**Post date:** [December 22, 2023, 9:00pm UTC](https://talk.observablehq.com/t/how-to-remove-left-and-right-margins-from-bar-chart-or-else-modify-the-x-axis-label-location/8643/1 "2023-12-22T21:00:14Z")

</div>

Hey folks 👋 happy holidays!

I’m trying to figure out how to get this horizontal bar chart displaying correctly. My goal is to get the x-axis label centered with no arrow and I’d like to have minimal margin on both the right and left, however, I keep playing whack-a-mole deciding if I should modify the `type` to `band` and then modify the margins, or if I should keep the default `type` and instead look at modifying the location of the x-axis label. Any help would be much appreciated!

Here is a notebook with both examples, I hope this helps explain it: [Bar Chart Margin Modification / Mike Talley | Observable](https://observablehq.com/d/5380ebe91e64460f)

---

<div class="post-metadata">

**Author:** ![Fil](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/fil/32/207_2.png) [@Fil](https://talk.observablehq.com/u/Fil)\
**Post date:** [December 22, 2023, 9:17pm UTC](https://talk.observablehq.com/t/how-to-remove-left-and-right-margins-from-bar-chart-or-else-modify-the-x-axis-label-location/8643/2 "2023-12-22T21:17:42Z")

</div>

try the `labelAnchor: "center"` option

---

<div class="post-metadata">

**Author:** ![miketalley](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/miketalley/32/8381_2.png) [@miketalley](https://talk.observablehq.com/u/miketalley)\
**Post date:** [December 22, 2023, 11:37pm UTC](https://talk.observablehq.com/t/how-to-remove-left-and-right-margins-from-bar-chart-or-else-modify-the-x-axis-label-location/8643/3 "2023-12-22T23:37:07Z")

</div>

Thanks @Fil, I’m not sure how I missed that, I feel like I looked through all of the docs. I was able to use `labelAnchor: "center"` and `labelArrow: "none"` to achieve the result I was looking for!
