本文整理汇总了Java中org.primefaces.model.chart.PieChartModel.set方法的典型用法代码示例。如果您正苦于以下问题:Java PieChartModel.set方法的具体用法?Java PieChartModel.set怎么用?Java PieChartModel.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.primefaces.model.chart.PieChartModel
的用法示例。
在下文中一共展示了PieChartModel.set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPieModel
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void createPieModel() {
pieModelUS = new PieChartModel();
pieModelUK = new PieChartModel();
for(AccountSummary obj:accountsInfo){
pieModelUS.set(obj.getAccountType(),new Double(obj.getBalanceUS()));
pieModelUK.set(obj.getAccountType(),new Double(obj.getBalanceUK()));
}
pieModelUS.setTitle("USD Marketvalue");
pieModelUS.setLegendPosition("w");
pieModelUS.setShowDataLabels(true);
pieModelUK.setTitle("UK Marketvalue");
pieModelUK.setLegendPosition("e");
pieModelUK.setFill(false);
pieModelUK.setShowDataLabels(true);
pieModelUK.setSliceMargin(5);
//pieModelUK.setDiameter(150);
}
示例2: preencherDadosGrafico
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void preencherDadosGrafico() {
dadosGrafico = new PieChartModel();
int contador = 1;
for (RecursoDTO recurso : dados) {
String descricaoTopico = criarDescricao(contador, recurso);
int participacoes = recurso.getQuantidade();
totalDePostagens += participacoes;
dadosGrafico.set(descricaoTopico, participacoes);
contador++;
}
}
示例3: createPieModel
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void createPieModel() {
pieModel = new PieChartModel();
for (Hotel h : hotelService.listHotel()) {
if (h.getComments().size() != 0) {
pieModel.set(h.getName(), h.getComments().size());
}
}
}
示例4: PrimeChartBean
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
public PrimeChartBean(){
pieModel1 = new PieChartModel();
pieModel1.set("Brand 1", 540);
pieModel1.set("Brand 2", 325);
pieModel1.set("Brand 3", 702);
pieModel1.set("Brand 4", 421);
pieModel1.setTitle("Simple Pie");
pieModel1.setLegendPosition("w");
}
示例5: createPieModel
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void createPieModel()
{
pieModel = new PieChartModel();
pieModel.set("Brand A", 540);
pieModel.set("Brand B", 325);
pieModel.set("Brand C", 702);
pieModel.set("Brand D", 421);
}
示例6: createPieModel
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void createPieModel()
{
pieModel = new PieChartModel();
pieModel.set("Brand 1", 540);
pieModel.set("Brand 2", 325);
pieModel.set("Brand 3", 702);
pieModel.set("Brand 4", 421);
}
示例7: createPieModel
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void createPieModel() {
pieModel = new PieChartModel();
pieModel.set("Brand 1", 540);
pieModel.set("Brand 2", 325);
pieModel.set("Brand 3", 702);
pieModel.set("Brand 4", 421);
}
示例8: createLivePieModel
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
private void createLivePieModel() {
livePieModel = new PieChartModel();
livePieModel.set("Candidate 1", 540);
livePieModel.set("Candidate 2", 325);
}
示例9: getPieChart
import org.primefaces.model.chart.PieChartModel; //导入方法依赖的package包/类
public PieChartModel getPieChart(Long id) {
List<FieldResult> fieldResults = formController.getFieldResults(id);
Map<String, Integer> results = new HashMap<String, Integer>();
for (FieldResult fieldResult : fieldResults) {
String value = fieldResult.getContent();
if (results.containsKey(value)) {
Integer count = results.get(fieldResult.getContent());
count++;
results.put(value, count);
} else {
results.put(value, 1);
}
}
PieChartModel pieChartModel = new PieChartModel();
Iterator<Entry<String, Integer>> itr = results.entrySet().iterator();
while (itr.hasNext()) {
Entry<String, Integer> entry = itr.next();
pieChartModel.set(entry.getKey() + " (" + entry.getValue() + ")", entry.getValue());
}
return pieChartModel;
}