loadApi(new Runnable() {
public void run() {
DataTable data = createDailyActivities();
// Create a minimal pie chart.
PieOptions pieOptions = PieChart.createPieOptions();
Options options = pieOptions;
// Common options
options.setAxisTitlesPosition("out");
options.setBackgroundColor(Color.create("pink", "black", 2));
ChartArea chartArea = ChartArea.create();
chartArea.setTop(5);
chartArea.setHeight(6);
chartArea.setWidth(7);
chartArea.setLeft(8);
options.setChartArea(chartArea);
options.setColors("pink", "black", "white");
options.setFontName("Verbena");
options.setFontSize(12);
options.setGridlineColor("blue");
options.setHeight(400);
options.setInterpolateNulls(true);
options.setLegend(LegendPosition.RIGHT);
TextStyle textStyle = TextStyle.create();
textStyle.setFontSize(10);
textStyle.setFontName("Courier New");
options.setLegendTextStyle(textStyle);
options.setLineWidth(5);
options.setTitle("My Daily Activities");
options.setTitleTextStyle(textStyle);
options.setTooltipTextStyle(textStyle);
options.setWidth(400);
// Pie specific
pieOptions.set3D(true);
pieOptions.setPieSliceText("data");
pieOptions.setPieSliceTextStyle(textStyle);
pieOptions.setPieResidueSliceLabel("Bling");
Widget widget = new PieChart(data, options);
RootPanel.get().add(widget);
Element div = widget.getElement();
// assert that the div's first child is an iframe