Chart is not redrawing

Hello, everyone.

I’m having a problem with the redrawing of a chart . Here is a part of the code where I try to do it:

salvarEdicaoGrafico.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { graficoGerado = gerarGrafico(((ChartType)getTipoGrafico().getValue()).toString(), evento,(Atributo)getComboAtributos().getValue()); graficoGerado.drawChart(); } }); As you can see, It’s inside a click listener, because the user select some of the parameters to build the chart. When he clicks to build one, I call a method that build and return a Chart and I assign it to a variable of the type Chart as well. After that, I call the method drawChart() to update the chart, but it is not updating it.

Hi Victor,

If you create a new Chart, there will be a new reference, which is not the same as what your ComponentContainer points to. What you also will need to do is to replace the old chart with this new one in your layout (or whatever container you used).

// Johan