Hello, I know it's been a while since you posted and warned me via face but only now I could actually look at this.
In your example you are creating a new graphic and adding in the collection, you could check if there is already an instance of the class in the Controls collection and get it but I tried to do some experiments and it is very annoying so my suggestion is as follows.
An object you add to the collection keeps your reference as long as the scope in which it was created is still active, what you can do is the following.
Declare the variable in the form's scope
public partial class Form1 : Form
{
System.Windows.Forms.DataVisualization.Charting.Chart cht_MacroOndas;
Check when the graphic is updated if the variable has not already been instantiated and only create a new case if necessary
private void button1_Click(object sender, EventArgs e)
{
if (cht_MacroOndas == null)
{
cht_MacroOndas = new Chart();
this.Controls.Add(cht_MacroOndas);
}
ConfigurarChat(cht_MacroOndas);
}
Remember to clear collections when using the previous chart object, I put this SetupChat method just to make it clear that at this point you would set the chart, in it you would have to zero the Series, Legends, ChartAreas, or any other collections that you add when filling in the data.