PDA

View Full Version : Pie chart not visible in IE or FF



smitha1003
22 Mar 2012, 11:05 PM
Piechart is not visible in IE and FF, however its visible in Chrome. Would appreciate if anyone has the solution.

Code Snippet
==========

String url = GXT.isIE ? "../../" : "";
url += "ExtGWT/chart/open-flash-chart.swf";

final Chart chart = new Chart(url);
chart.setBorders(false);
//chart.setHeight(250);


cp.add(chart);
add(cp);

GwtRemoteService.MyUtil.getInstance().findAllApplication(
new AsyncCallback<List<ApplicationMasterDetails>>() {


@Override
public void onFailure(Throwable caught) {
Window.alert(caught.getMessage());
}


@Override
public void onSuccess(List<ApplicationMasterDetails> result) {
chart.setChartModel(getPieChartData(MyUtil
.convertIntoPieChartPropertiesForApplications(result)));
chart.repaint();
cp.layout();
}
});
}

harun
26 Mar 2012, 4:07 AM
Hi, I also have same problem 3 months ago but I solved the problem.

I added chart to content panel in the rpc onsuccess method. The following code helps you:



@Override
public void onSuccess( List<ModelData> result)
{
callback.onSuccess( result );
chart.refresh();
if ( !chart.isAttached() ) {
cp.add( chart );
cp.layout();
}
}