# Changing background plotly.js

**URL:** <https://community.plotly.com/t/changing-background-plotly-js/40138>\
**Category:** plotly.js\
**Created:** [May 27, 2020, 4:38am UTC](https://community.plotly.com/t/changing-background-plotly-js/40138 "2020-05-27T04:38:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsalzedon](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@dsalzedon](https://community.plotly.com/u/dsalzedon)\
**Post date:** [May 27, 2020, 4:38am UTC](https://community.plotly.com/t/changing-background-plotly-js/40138/1 "2020-05-27T04:38:12Z")

</div>

Hi  
I’m currently using a “gauge” graph on my personal website but, I can’t get to change the background color from white to another color that I want. How am I able to do this?  
This is the example code:

```auto
var data = [
	{
		domain: { x: [0, 1], y: [0, 1] },
		value: 270,
		title: { text: "Speed" },
		type: "indicator",
		mode: "gauge+number"
	}
];

var layout = { width: 600, height: 500, margin: { t: 0, b: 0 }, };
Plotly.newPlot('myDiv', data, layout);

```

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![Krister](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@Krister](https://community.plotly.com/u/Krister)\
**Post date:** [October 22, 2020, 4:45pm UTC](https://community.plotly.com/t/changing-background-plotly-js/40138/2 "2020-10-22T16:45:45Z")

</div>

Try setting a value for layout.paper\_bgcolor

> **[Single-Page Reference](https://plotly.com/javascript/reference/#layout-paper_bgcolor)**
>
> Figure attribute reference for Plotly's JavaScript open-source graphing library.
