本文整理汇总了Java中org.primefaces.model.chart.ChartSeries类的典型用法代码示例。如果您正苦于以下问题:Java ChartSeries类的具体用法?Java ChartSeries怎么用?Java ChartSeries使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChartSeries类属于org.primefaces.model.chart包,在下文中一共展示了ChartSeries类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fileDownloadStatis
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
public void fileDownloadStatis() {
if(selectedDataFileId == 0){
queryForFile.setDatafileIds(allDataFileIds);
}else{
queryForFile.setDatafileIds(Arrays.asList(selectedDataFileId));
}
logForFile = usageLogSearchService.search(queryForFile);
statisForFile = new CartesianChartModel();
ChartSeries downloadAmount = new ChartSeries();
downloadAmount.setLabel(ResourceBundle.getBundle("Bundle", FacesContext.getCurrentInstance().getViewRoot().getLocale()).getString("log.filedownload.distribute.label"));
for(Pair<String,Long> pair : logForFile.getDateHistogram()){
downloadAmount.set(pair.getFirst(), pair.getSecond());
}
statisForFile.addSeries(downloadAmount);
}
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:17,代码来源:UsageLogStatisPage.java
示例2: initBarModelIndividual
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private BarChartModel initBarModelIndividual() {
BarChartModel model = new BarChartModel();
model.setTitle("Desempenho individual");
model.setAnimate(true);
model.setLegendPosition("ne");
Axis yAxis = model.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(20);
Pessoa usuario = loginBean.getUsuario();
ChartSeries acertos = new ChartSeries();
acertos.setLabel("Acertos");
ChartSeries erros = new ChartSeries();
erros.setLabel("Erros");
for (int i = 0; i < listMaterias.size(); i++) {
Long acertosMat = pessoaAcertosRepository.getAcertosMateriaIndividual(listMaterias.get(i).getId(), usuario.getId());
acertos.set(listMaterias.get(i).getDescricao(), acertosMat);
Long errosMat = pessoaAcertosRepository.getErrosMateriaIndividual(listMaterias.get(i).getId(), usuario.getId());
erros.set(listMaterias.get(i).getDescricao(), errosMat);
}
model.addSeries(acertos);
model.addSeries(erros);
return model;
}
示例3: initCategoryModel
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private LineChartModel initCategoryModel() {
LineChartModel model = new LineChartModel();
ChartSeries alcohol = new ChartSeries();
alcohol.setLabel("Alcohol");
alcohol.set("2004", 120);
alcohol.set("2005", 100);
alcohol.set("2006", 44);
alcohol.set("2007", 150);
alcohol.set("2008", 25);
ChartSeries heat = new ChartSeries();
heat.setLabel("Heat");
heat.set("2004", 52);
heat.set("2005", 60);
heat.set("2006", 110);
heat.set("2007", 90);
heat.set("2008", 120);
model.addSeries(alcohol);
model.addSeries(heat);
return model;
}
示例4: createTimeBarChart
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createTimeBarChart() {
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.add(Calendar.HOUR, (NUMBER_OF_HOURS_TO_DISPLAY_ON_BAR_CHART - 1) * -1);
List<TweetCountPerHour> tweetCountPerHour = analyticsController.getTweetCountPerHour(calendar.getTime(), now);
tweetCountPerTimeChartModel = new LineChartModel();
tweetCountPerTimeChartModel.setShowPointLabels(true);
ChartSeries chartSeries = new ChartSeries();
chartSeries.setLabel("Tweets");
tweetCountPerTimeChartModel.setAnimate(true);
tweetCountPerTimeChartModel.setShadow(false);
Date endTime;
for (TweetCountPerHour tweetCount : tweetCountPerHour) {
calendar = Calendar.getInstance();
calendar.setTime(tweetCount.getHour());
calendar.add(Calendar.HOUR, 1);
endTime = calendar.getTime();
chartSeries.set(timeFormat.format(tweetCount.getHour()) + " - " + timeFormat.format(endTime),
tweetCount.getCount());
}
tweetCountPerTimeChartModel.addSeries(chartSeries);
tweetCountPerTimeChartModel.getAxes().put(AxisType.X, new CategoryAxis());
Axis yAxis = tweetCountPerTimeChartModel.getAxis(AxisType.Y);
yAxis.setLabel("Tweets");
yAxis.setMin(0);
}
示例5: createDayBarChart
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createDayBarChart() {
Calendar calendar = Calendar.getInstance();
Date now = calendar.getTime();
calendar.add(Calendar.DATE, (NUMBER_OF_DAYS_TO_DISPLAY_ON_BAR_CHART - 1) * -1);
List<TweetCountPerDay> tweetCountPerDay = analyticsController.getTweetCountPerDay(calendar.getTime(), now);
tweetCountPerDayChartModel = new BarChartModel();
tweetCountPerDayChartModel.setShowPointLabels(true);
ChartSeries chartSeries = new ChartSeries();
chartSeries.setLabel("Tweets");
tweetCountPerDayChartModel.setAnimate(true);
tweetCountPerDayChartModel.setShadow(false);
Date endTime;
for (TweetCountPerDay tweetCount : tweetCountPerDay) {
calendar = Calendar.getInstance();
calendar.setTime(tweetCount.getDay());
calendar.add(Calendar.DATE, 1);
endTime = calendar.getTime();
chartSeries.set(dateFormat.format(tweetCount.getDay()) + " - " + dateFormat.format(endTime),
tweetCount.getCount());
}
tweetCountPerDayChartModel.addSeries(chartSeries);
tweetCountPerDayChartModel.getAxes().put(AxisType.X, new CategoryAxis());
Axis yAxis = tweetCountPerDayChartModel.getAxis(AxisType.Y);
yAxis.setLabel("Tweets");
yAxis.setMin(0);
}
示例6: createRankBarChart
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createRankBarChart() {
characterRankChartModel = new HorizontalBarChartModel();
characterRankChartModel.setShowPointLabels(true);
ChartSeries chartSeries = new ChartSeries();
chartSeries.setLabel("Tweets");
characterRankChartModel.setAnimate(true);
characterRankChartModel.setShadow(false);
List<CharacterRankPosition> charactersRank = analyticsController.getCharactersRank();
for (CharacterRankPosition characterRankPosition : charactersRank) {
chartSeries.set(characterRankPosition.getCharacter().getPrintableName(), characterRankPosition.getRefs());
}
characterRankChartModel.addSeries(chartSeries);
Axis xAxis = characterRankChartModel.getAxis(AxisType.X);
xAxis.setLabel("Tweets");
xAxis.setMin(0);
}
示例7: createBarChartModel
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createBarChartModel() {
barChartModel = new CartesianChartModel();
ChartSeries boys = new ChartSeries();
boys.setLabel("Boys");
boys.set("2004", 50);
boys.set("2005", 96);
boys.set("2006", 44);
boys.set("2007", 55);
boys.set("2008", 25);
ChartSeries girls = new ChartSeries();
girls.setLabel("Girls");
girls.set("2004", 52);
girls.set("2005", 60);
girls.set("2006", 82);
girls.set("2007", 35);
girls.set("2008", 120);
barChartModel.addSeries(boys);
barChartModel.addSeries(girls);
}
示例8: createComponent
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
@Override
public Object createComponent(String widgetId) {
this.widgetId = widgetId;
model = new CartesianChartModel();
ChartSeries series1 = new ChartSeries(widget.getProperties().get(0).getKey());
// TODO buscar os valores atualizados da propriedade do device
Integer randomNum = new Random().nextInt((100 - 0) + 1) + 1;
series1.set(++count, randomNum);
model.addSeries(series1);
chart = new LineChart();
chart.setValue(model);
return chart;
}
示例9: createComponent
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
@Override
public Object createComponent(String widgetId) {
this.widgetId = widgetId;
model = new CartesianChartModel();
for (Property prop : widget.getProperties()) {
ChartSeries series = new ChartSeries(prop.getDevice().getKey());
// TODO buscar os valores atualizados da propriedade do device
Integer randomNum = new Random().nextInt((100 - 0) + 1) + 1;
series.set(prop.getKey(), randomNum);
model.addSeries(series);
}
chart = new BarChart();
//chart.setOrientation("horizontal");
//chart.setLegendPosition("ne");
//chart.setYaxisAngle(90);
chart.setValue(model);
//chart.setStyle("height: 100px; width: 100px;");
return chart;
}
示例10: update
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
@Override
public void update() {
for (ChartSeries series : model.getSeries()) {
String deviceKey = series.getLabel();
String propertyKey = (String) series.getData().keySet().iterator().next();
service.get(deviceKey, propertyKey);
// TODO
Integer randomNum = new Random().nextInt((100 - 0) + 1) + 1;
series.set(propertyKey, randomNum);
}
logger.debug("Updated bar widget '" + widgetId + "' at "
+ new Date());
}
示例11: createComponent
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
@Override
public Object createComponent(String widgetId) {
this.widgetId = widgetId;
model = new CartesianChartModel();
for (Property prop : widget.getProperties()) {
ChartSeries series = new ChartSeries(prop.getDevice().getKey());
Double value = 0d;
if (prop.getValue() != null && !"".equals(prop.getValue())) {
value = new Double(prop.getValue());
}
series.set(prop.getKey(), value);
model.addSeries(series);
}
chart = new LineChart();
chart.setFill(true);
chart.setStacked(true);
chart.setValue(model);
return chart;
}
示例12: update
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
@Override
public void update() {
for (ChartSeries series : model.getSeries()) {
String deviceKey = series.getLabel();
String propertyKey = (String) series.getData().keySet().iterator().next();
Property property = service.get(deviceKey, propertyKey);
Double value = 0d;
try {
value = new Double(property.getValue());
} catch (Exception ex) {
logger.error("Error to get the updated value for the property '"
+ property.getKey() + "'", ex);
}
series.set(propertyKey, value);
}
logger.debug("Updated area widget '" + widgetId + "' at "
+ new Date());
}
示例13: createCategoryModel
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createCategoryModel() {
categoryModel = new BarChartModel();
ChartSeries balanceUS = new ChartSeries();
ChartSeries balanceUK = new ChartSeries();
for(AccountSummary obj:accountsInfo){
balanceUS.set(obj.getAccountType(),new Double(obj.getBalanceUS()));
balanceUK.set(obj.getAccountType(),new Double(obj.getBalanceUK()));
}
balanceUS.setLabel("US_Balance");
balanceUK.setLabel("UK_Balance");
categoryModel.addSeries(balanceUS);
categoryModel.addSeries(balanceUK);
categoryModel.setTitle("Marketvalue");
categoryModel.setLegendPosition("w");
categoryModel.setShowPointLabels(true);
}
示例14: createCategoryModel
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createCategoryModel() {
categoryModel = new CartesianChartModel();
ChartSeries boys = new ChartSeries();
boys.setLabel("Boys");
boys.set("2004", 120);
boys.set("2005", 100);
boys.set("2006", 44);
boys.set("2007", 150);
boys.set("2008", 25);
ChartSeries girls = new ChartSeries();
girls.setLabel("Girls");
girls.set("2004", 52);
girls.set("2005", 60);
girls.set("2006", 110);
girls.set("2007", 135);
girls.set("2008", 120);
categoryModel.addSeries(boys);
categoryModel.addSeries(girls);
}
示例15: createCategoryModel
import org.primefaces.model.chart.ChartSeries; //导入依赖的package包/类
private void createCategoryModel() {
categoryModel = new CartesianChartModel();
ChartSeries boys = new ChartSeries();
boys.setLabel("Boys");
boys.set("2004", 120);
boys.set("2005", 100);
boys.set("2006", 44);
boys.set("2007", 150);
boys.set("2008", 25);
ChartSeries girls = new ChartSeries();
girls.setLabel("Girls");
girls.set("2004", 52);
girls.set("2005", 60);
girls.set("2006", 110);
girls.set("2007", 135);
girls.set("2008", 120);
categoryModel.addSeries(boys);
categoryModel.addSeries(girls);
}