# Best way to update graph without creating and passing an object with new vars

**URL:** <https://community.plotly.com/t/best-way-to-update-graph-without-creating-and-passing-an-object-with-new-vars/6816>\
**Category:** 📊 Plotly Python\
**Created:** [November 14, 2017, 6:37pm UTC](https://community.plotly.com/t/best-way-to-update-graph-without-creating-and-passing-an-object-with-new-vars/6816 "2017-11-14T18:37:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harryntuits](https://avatars.discourse-cdn.com/v4/letter/h/34f0e0/32.png) [@harryntuits](https://community.plotly.com/u/harryntuits)\
**Post date:** [November 14, 2017, 6:37pm UTC](https://community.plotly.com/t/best-way-to-update-graph-without-creating-and-passing-an-object-with-new-vars/6816/1 "2017-11-14T18:37:12Z")

</div>

Here’s my file:  
[Plotly file](https://paste.ee/p/u0G1Q)

I’m trying to update ‘data’ to newData’. I’m avoiding using newPlot due to memory constraints and the data content is returned from the server with a number of varying options.

Therefore:

var data = [ {  
x: [‘VALUE 1’], // in reality I have more values…  
y: [20],  
type: ‘bar’  
}  
];

This method is unavailable to me as it could have x,y,y2… etc and I can’t account for all the possibilities.  
I just need it to update the traces, I don’t need a new plot.

Please assist.
