public PieChartModel getLivePieModel() { int random1 = (int) (Math.random() * 1000); int random2 = (int) (Math.random() * 1000); liveChartModel.getData().put("Candidate 1", random1); liveChartModel.getData().put("Candidate 2", random2); liveChartModel.setLegendPosition("w"); liveChartModel.setShowDataLabels(true); return liveChartModel; }
private PieChartModel createPieChartModel() { PieChartModel model = new PieChartModel(); model.setLegendPosition("w"); model.setShowDataLabels(true); model.set("Work", 11); model.set("Eat", 2); model.set("Commute", 2); model.set("Watch TV", 2); model.set("Sleep", 7); return model; }