当前位置: 首页>>代码示例>>Java>>正文


Java Axis.setLabel方法代码示例

本文整理汇总了Java中org.primefaces.model.chart.Axis.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.setLabel方法的具体用法?Java Axis.setLabel怎么用?Java Axis.setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.primefaces.model.chart.Axis的用法示例。


在下文中一共展示了Axis.setLabel方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTimeBarChart

import org.primefaces.model.chart.Axis; //导入方法依赖的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);
}
 
开发者ID:danielgimenes,项目名称:SmashBrosTwitterAnalytics,代码行数:27,代码来源:AnalyticsBean.java

示例2: createDayBarChart

import org.primefaces.model.chart.Axis; //导入方法依赖的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);
}
 
开发者ID:danielgimenes,项目名称:SmashBrosTwitterAnalytics,代码行数:27,代码来源:AnalyticsBean.java

示例3: createRankBarChart

import org.primefaces.model.chart.Axis; //导入方法依赖的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);
}
 
开发者ID:danielgimenes,项目名称:SmashBrosTwitterAnalytics,代码行数:17,代码来源:AnalyticsBean.java

示例4: initLinearModel

import org.primefaces.model.chart.Axis; //导入方法依赖的package包/类
private LineChartModel initLinearModel() {
    LineChartModel model = new LineChartModel();
    
    model.setStacked(true);
    model.setShowPointLabels(true);
    model.setTitle("Matematica");
    model.setLegendPosition("ne");
    
    Axis xAxis = new CategoryAxis("Anos");
    model.getAxes().put(AxisType.X, xAxis);
    
    xAxis.setLabel("Quantidade");
    Axis yAxis = model.getAxis(AxisType.Y);
    yAxis.setMin(0);
    yAxis.setMax(20);

    
    LineChartSeries series1 = new LineChartSeries();
    series1.setLabel("Acertos");
    series1.set("2014", 50);
    series1.set("2013", 40);
    series1.set("2012", 30);
    series1.set("2011", 20);
    series1.set("2010", 10);
 
    LineChartSeries series2 = new LineChartSeries();
    series2.setLabel("Erros"); 
    series2.set("2014", 20);
    series2.set("2013", 19);
    series2.set("2012", 16);
    series2.set("2011", 14);
    series2.set("2010", 12);
 
    model.addSeries(series1);
    model.addSeries(series2);
     
    return model;
}
 
开发者ID:Corlobin,项目名称:Pecomp,代码行数:39,代码来源:DesempenhoEstudanteBean.java

示例5: preRender

import org.primefaces.model.chart.Axis; //导入方法依赖的package包/类
public void preRender() {
	this.model = new LineChartModel();
	this.model.setTitle("Pedidos criados");
	this.model.setAnimate(true);

	this.model.setLegendPosition("e");

	this.model.getAxes().put(AxisType.X, new CategoryAxis("Datas"));

	Axis yAxis = this.model.getAxis(AxisType.Y);
	yAxis.setLabel("Valores");
	yAxis.setMin(0);
	// yAxis.setMax(1100);

	adicionarSeries("Todos os pedidos", null);
	adicionarSeries("Meus pedidos", this.usuarioLogado.getUsuario());

	// ModelPie
	this.modelPie = new PieChartModel();

	Map<String, BigDecimal> valoresPorUsuario = this.pedidos.valoresTotaisPorVendedor();

	for (String usuario : valoresPorUsuario.keySet()) {
		this.modelPie.set(usuario, valoresPorUsuario.get(usuario));
	}

	this.modelPie.setTitle("Totais por Vendedor");
	this.modelPie.setLegendPosition("w");
	this.modelPie.setShowDataLabels(true);
	this.modelPie.setShadow(true);
}
 
开发者ID:fabiohxcx,项目名称:PedidoVenda,代码行数:32,代码来源:GraficosPedidosCriadosBean.java

示例6: createLineModels

import org.primefaces.model.chart.Axis; //导入方法依赖的package包/类
private void createLineModels() {
    lineModel = initCategoryModel();
    lineModel.setTitle("Category Chart");
    lineModel.setLegendPosition("e");
    lineModel.setShowPointLabels(true);
    lineModel.getAxes().put(AxisType.X, new CategoryAxis("Months"));
    Axis yAxis = lineModel.getAxis(AxisType.Y);
    yAxis.setLabel("TODO");
    yAxis.setMin(0);
    yAxis.setMax(200);
}
 
开发者ID:bartgerard,项目名称:ubrew_v0.1,代码行数:12,代码来源:MyBrewBean.java

示例7: initLine

import org.primefaces.model.chart.Axis; //导入方法依赖的package包/类
/**
 * Initializes the Line Model for the chart in the web view
 */
public void initLine() {
	// init new bar model
	model = new LineChartModel();
	model.setLegendPosition("e");
	model.setLegendPlacement(LegendPlacement.OUTSIDEGRID);
	//set configurations
	((LineChartModel) model).setShowPointLabels(true);
	((LineChartModel) model).getAxes().put(AxisType.X, new CategoryAxis(""));
	Axis yAxis = ((LineChartModel) model).getAxis(AxisType.Y);
	yAxis.setLabel("");
	//init chart with line model
	initChart(model);
}
 
开发者ID:dice-group,项目名称:IGUANA,代码行数:17,代码来源:GraphController.java

示例8: initLinearPorInsituicao

import org.primefaces.model.chart.Axis; //导入方法依赖的package包/类
private LineChartModel initLinearPorInsituicao() {
    this.instituicao = instituicoesRepository.getById(idInstituicaoSelecionada);
	
	LineChartModel model = new LineChartModel();
    
    model.setStacked(true);
    model.setShowPointLabels(true);
    model.setTitle(instituicao.getNome());
    model.setLegendPosition("ne");
    
    Axis xAxis = new CategoryAxis("Disciplinas");
    model.getAxes().put(AxisType.X, xAxis);
    
    xAxis.setLabel("Disciplinas");
    Axis yAxis = model.getAxis(AxisType.Y);
    yAxis.setMin(0);
    yAxis.setMax(20);
    
    LineChartSeries acertos = new LineChartSeries();
    acertos.setLabel("Acertos");  
    
    LineChartSeries erros = new LineChartSeries();
    erros.setLabel("Erros");
    
    for (int i = 0; i < listMaterias.size(); i++) {
    	Long count = pessoaAcertosRepository.getAcertosInstituicaoPorMateria(idInstituicaoSelecionada, listMaterias.get(i).getId());
    	acertos.set(listMaterias.get(i).getDescricao(), count);  
    	
    	Long count2 = pessoaAcertosRepository.getErrosInstituicaoPorMateria(idInstituicaoSelecionada, listMaterias.get(i).getId());
    	erros.set(listMaterias.get(i).getDescricao(), count2);
    	
    	//Apenas para verificar erro no resultado (apagar!!)
    	String a = listMaterias.get(i).getDescricao();
    	System.out.println("Acertos mat e count:  " + a + count);
    	System.out.println("Erros mat e count:  " + a + count2);
    }
   
   
    model.addSeries(acertos);
    model.addSeries(erros);
    
    
    idInstituicaoSelecionada = null;
     
    return model;

}
 
开发者ID:Corlobin,项目名称:Pecomp,代码行数:48,代码来源:DesempenhoInstituicaoBean.java


注:本文中的org.primefaces.model.chart.Axis.setLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。