# Standard Chart XY Bar Renderer Change Margin in Code

**URL:** <https://forum.inductiveautomation.com/t/standard-chart-xy-bar-renderer-change-margin-in-code/1964>\
**Category:** Archived Topics\
**Created:** [June 22, 2010, 5:06pm UTC](https://forum.inductiveautomation.com/t/standard-chart-xy-bar-renderer-change-margin-in-code/1964 "2010-06-22T17:06:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [June 22, 2010, 5:06pm UTC](https://forum.inductiveautomation.com/t/standard-chart-xy-bar-renderer-change-margin-in-code/1964/1 "2010-06-22T17:06:10Z")

</div>

Carl,

Do you have some code I could use to change the margin value on my standard charts XY Bar Renderer dataset? I am making a histogram and depending on the size of the bins the margin needs to change so the bars do not look all smashed together.

Thanks,

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 23, 2010, 4:06pm UTC](https://forum.inductiveautomation.com/t/standard-chart-xy-bar-renderer-change-margin-in-code/1964/2 "2010-06-23T16:06:33Z")

</div>

Try this:

`chart = ... get the chart
chart.dynamicProps.get("Data").renderer.margin = 0.4
chart.createChart()`
