SERVER CODE:
package space.gui.server;
public ChartWidget addPieChart(boolean inp){
ChartWidget chart = new ChartWidget();
ChartData cd = new ChartData("Sales by Region", "font-size: 14px;
font-family: Verdana; text-align: center;");
cd.setBackgroundColour("#ffffff");
PieChart pie = new PieChart();
pie.setAlpha(0.3f);
pie.setNoLabels(true);
pie.setTooltip("#label# $#val#<br>#percent#");
pie.setAnimateOnShow(true);
pie.setGradientFill(true);
pie.setColours("#ff0000", "#00ff00", "#0000ff", "#ff9900",
"#ff00ff");
pie.addSlices(new PieChart.Slice(11000, "AU"));
pie.addSlices(new PieChart.Slice(88000, "USA"));
pie.addSlices(new PieChart.Slice(62000, "UK"));
pie.addSlices(new PieChart.Slice(14000, "JP"));
pie.addSlices(new PieChart.Slice(43000, "EU"));
//ImageServiceAsync imgService = (ImageServiceAsync) GWT.create
(ImageService.class);
//ServiceDefTarget target = (ServiceDefTarget) imgService;
//target.setServiceEntryPoint("ImageService");
cd.addElements(pie);
chart.setSize("300", "300");
chart.setJsonData(cd.toString());
return chart;
}
I want to convert this chart to String and then pass to client so that
the client should be able to read and display the string as Chart.
or do youu suggest any alternative solution?