本文整理汇总了Java中org.primefaces.model.chart.AxisType类的典型用法代码示例。如果您正苦于以下问题:Java AxisType类的具体用法?Java AxisType怎么用?Java AxisType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxisType类属于org.primefaces.model.chart包,在下文中一共展示了AxisType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
@PostConstruct
public void init() {
setSensors(sensorContainer.getSensors());
setActors(actorContainer.getActors());
graphs = new HashMap<>();
liveChartModel = new LineChartModel();
liveChartModel.setTitle("Live Data");
liveChartModel.setLegendPosition("e");
xAxis = new DateAxis("Time");
xAxis.setTickAngle(-55);
xAxis.setTickCount(31);
xAxis.setTickFormat("%H:%M:%S");
liveChartModel.getAxes().put(AxisType.X, xAxis);
selectedSensors = new ArrayList<>();
selectedSensors.add(sensors.get(0));
refresh();
}
开发者ID:daergoth,项目名称:hiots,代码行数:22,代码来源:LiveManager.java
示例2: initBarModelIndividual
import org.primefaces.model.chart.AxisType; //导入依赖的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;
}
开发者ID:Corlobin,项目名称:Pecomp,代码行数:33,代码来源:DesempenhoEstudanteBean.java
示例3: constructChartModel
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
private LineChartModel constructChartModel(DatePeriod datePeriod, LineChartSeries lineChartSeries1, LineChartSeries lineChartSeries2, int max) {
LineChartModel lineChartModel = new LineChartModel();
lineChartModel.setExtender("ext"); // must exist javascript function
// ext(), which sets conf. data
DateAxis xAxis = new DateAxis();
xAxis.setMin(datePeriod.getDateFrom().getTime() - 10000);
xAxis.setMax(datePeriod.getDateTo().getTime() + 10000);
lineChartModel.getAxes().put(AxisType.X, xAxis);
Axis yAxis = lineChartModel.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(max + max / 10);
lineChartModel.addSeries(lineChartSeries1);
lineChartModel.addSeries(lineChartSeries2);
return lineChartModel;
}
开发者ID:jirkapinkas,项目名称:sitemonitoring-production,代码行数:18,代码来源:CheckResultsController.java
示例4: createTimeBarChart
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例5: createDayBarChart
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例6: createRankBarChart
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例7: initLinearModel
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
private void initLinearModel() {
/* 48 */ this.lineModel = new LineChartModel();
/* 49 */ this.lineModel.setTitle("Linear Chart");
/* 50 */ this.lineModel.setLegendPosition("e");
/* 51 */ this.lineModel.setExtender("skinChart");
/* 52 */ this.lineModel.setAnimate(true);
/* 53 */ Axis yAxis = this.lineModel.getAxis(AxisType.Y);
/* 54 */ yAxis.setMin(Integer.valueOf(0));
/* 55 */ yAxis.setMax(Integer.valueOf(10));
/* */
/* 57 */ LineChartSeries series1 = new LineChartSeries();
/* 58 */ series1.setLabel("Series 1");
/* */
/* 60 */ series1.set(Integer.valueOf(1), Integer.valueOf(2));
/* 61 */ series1.set(Integer.valueOf(2), Integer.valueOf(1));
/* 62 */ series1.set(Integer.valueOf(3), Integer.valueOf(3));
/* 63 */ series1.set(Integer.valueOf(4), Integer.valueOf(6));
/* 64 */ series1.set(Integer.valueOf(5), Integer.valueOf(8));
/* */
/* 66 */ LineChartSeries series2 = new LineChartSeries();
/* 67 */ series2.setLabel("Series 2");
/* */
/* 69 */ series2.set(Integer.valueOf(1), Integer.valueOf(6));
/* 70 */ series2.set(Integer.valueOf(2), Integer.valueOf(3));
/* 71 */ series2.set(Integer.valueOf(3), Integer.valueOf(2));
/* 72 */ series2.set(Integer.valueOf(4), Integer.valueOf(7));
/* 73 */ series2.set(Integer.valueOf(5), Integer.valueOf(9));
/* */
/* 75 */ this.lineModel.addSeries(series1);
/* 76 */ this.lineModel.addSeries(series2);
/* */ }
开发者ID:marlonalexis,项目名称:Multicentro_Mascotas,代码行数:32,代码来源:ChartView.java
示例8: _createDateModel
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
public void _createDateModel() {
model = new LineChartModel();
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("Series 1");
IntervaloDatas interval = new VendasTotaisPorDataFilter(15);
// Set<DataValor> vendasPorData =
// pedidos.valoresTotaisPorData(interval);
//
// for (DataValor dataValor : vendasPorData) {
// series1.set(dataValor.getData(), dataValor.getValor());
// }
series1.set(new Date(), BigDecimal.ZERO);
model.addSeries(series1);
// model.addSeries(series2);
model.setTitle("Zoom for Details");
model.setZoom(true);
model.getAxis(AxisType.Y).setLabel("Values");
model.setLegendPosition("e");
DateAxis axis = new DateAxis("Dates");
axis.setTickAngle(-50);
// axis.setMin(interval.getDataInicial());
axis.setMax(interval.getDataFinal());
axis.setTickFormat("%b %#d, %y");
model.getAxes().put(AxisType.X, axis);
}
开发者ID:marcelothebuilder,项目名称:webpedidos,代码行数:33,代码来源:GraficoPedidosCriadosBean.java
示例9: generateScoreDistributionModelView
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
public void generateScoreDistributionModelView(List<MetFragResult> results) {
if(results.size() <= 1) {
this.scoreDistributionModel = null;
return;
}
this.scoreDistributionModel = new LineChartModel();
this.scoreDistributionModel.getAxis(AxisType.X).setLabel("Candidate Index");
this.scoreDistributionModel.getAxis(AxisType.Y).setLabel("Score");
this.scoreDistributionModel.setExtender("extenderScore");
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("Final Score");
this.legendLabels = "['Final Score'";
LineChartSeries[] scores = new LineChartSeries[this.showScoreGraphs.length];
for(int k = 0; k < this.showScoreGraphs.length; k++) {
scores[k] = new LineChartSeries();
scores[k].setShowMarker(false);
scores[k].setLabel(this.scoreGraphNames[k]);
this.legendLabels += ",'" + this.scoreGraphNames[k] + "'";
}
this.scoreDistributionModel.setMouseoverHighlight(false);
this.scoreDistributionModel.setShowDatatip(false);
this.scoreDistributionModelPointLabels = "['" + results.get(0).getIdentifier() + "'";
series1.set(1, results.get(0).getScore());
for(int k = 0; k < this.showScoreGraphs.length; k++)
scores[k].set(1, results.get(0).getRoot().getSingleScore(this.showScoreGraphs[k]));
for(int i = 1; i < results.size(); i++) {
series1.set((i + 1), results.get(i).getScore());
this.scoreDistributionModelPointLabels += ",'" + results.get(i).getIdentifier() + "'";
for(int k = 0; k < this.showScoreGraphs.length; k++)
scores[k].set((i + 1), results.get(i).getRoot().getSingleScore(this.showScoreGraphs[k]));
}
this.scoreDistributionModel.addSeries(series1);
for(int k = 0; k < this.showScoreGraphs.length; k++) {
this.scoreDistributionModel.addSeries(scores[k]);
}
this.scoreDistributionModelPointLabels += "]";
this.legendLabels += "]";
}
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:39,代码来源:CandidateStatistics.java
示例10: initBarModel
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
private BarChartModel initBarModel() {
BarChartModel model = new BarChartModel();
model.setTitle("Desempenho geral");
model.setAnimate(true);
model.setLegendPosition("ne");
Axis yAxis = model.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(20);
ChartSeries acertos = new ChartSeries();
acertos.setLabel("Acertos");
ChartSeries erros = new ChartSeries();
erros.setLabel("Erros");
for (int i = 0; i < listMaterias.size(); i++) {
Long acertosMateria = pessoaAcertosRepository.getAcertosMateriaGeral(listMaterias.get(i).getId());
acertos.set(listMaterias.get(i).getDescricao(), acertosMateria);
Long errosMateria = pessoaAcertosRepository.getErrosMateriaGeral(listMaterias.get(i).getId());
erros.set(listMaterias.get(i).getDescricao(), errosMateria);
}
model.addSeries(acertos);
model.addSeries(erros);
return model;
}
开发者ID:Corlobin,项目名称:Pecomp,代码行数:31,代码来源:DesempenhoEstudanteBean.java
示例11: initLinearModel
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例12: initBarModel
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
private BarChartModel initBarModel() {
BarChartModel model = new BarChartModel();
model.setTitle("Todas as Instituições");
model.setAnimate(true);
model.setLegendPosition("ne");
Axis yAxis = model.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(20);
ChartSeries acertos = new ChartSeries();
acertos.setLabel("Acertos");
ChartSeries erros = new ChartSeries();
erros.setLabel("Erros");
for (int i = 0; i < listInstituicao.size(); i++) {
Long acertosInstituicao = pessoaAcertosRepository.getAcertosInstituicaoGeral(listInstituicao.get(i).getId());
acertos.set(listInstituicao.get(i).getNome(), acertosInstituicao);
Long errosInstituicao = pessoaAcertosRepository.getErrosInstituicaoGeral(listInstituicao.get(i).getId());
erros.set(listInstituicao.get(i).getNome(), errosInstituicao);
}
model.addSeries(acertos);
model.addSeries(erros);
return model;
}
开发者ID:Corlobin,项目名称:Pecomp,代码行数:31,代码来源:DesempenhoInstituicaoBean.java
示例13: preRender
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例14: createLineModels
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例15: createLineModels
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
private void createLineModels() {
lineModel = initLinearModel();
lineModel.setTitle("Oil Production (MBPD vs time in years)");
lineModel.setLegendPosition("e");
Axis xAxis = lineModel.getAxis(AxisType.X);
xAxis.setMin(1900);
xAxis.setMax(2050);
xAxis.setTickInterval("10");
Axis yAxis = lineModel.getAxis(AxisType.Y);
yAxis.setMin(0);
}
开发者ID:ajurjens,项目名称:JRBE,代码行数:12,代码来源:ChartView.java
示例16: initLine
import org.primefaces.model.chart.AxisType; //导入依赖的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
示例17: Molecule
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
public Molecule(String identifier, double mass, String formula, final List<Weight> weights,
String imageAddress, final ScoreSummary[] scoresSummaries, String inchi) {
super();
this.additionalValues = new int[] {100, 200, 110};
this.identifier = identifier;
this.mass = mass;
this.formula = formula;
this.displayFormula = this.formula.replaceAll("([0-9]+)", "<sub>$1</sub>");
this.scoresSummaries = scoresSummaries;
this.recalculateScore(weights);
this.inchi = inchi;
this.imageAddress = imageAddress;
this.horizontalBarModel = new HorizontalBarChartModel();
ChartSeries scoreCharts = new ChartSeries();
scoreCharts.setLabel("Scores");
int scoreNotForGraphNumber = 0;
int numberNotForScore = 0;
for(int i = this.scoresSummaries.length - 1; i >= 0; i--)
if(!this.scoresSummaries[i].isUsedForScoring()) numberNotForScore++;
for(int i = this.scoresSummaries.length - 1; i >= 0; i--) {
if(!this.scoresSummaries[i].isUsedForScoring()) {
scoreNotForGraphNumber++;
continue;
}
String end = "th";
int scoreIndex = i - numberNotForScore + 1 + scoreNotForGraphNumber;
if(scoreIndex == 1) end = "st";
if(scoreIndex == 2) end = "nd";
if(scoreIndex == 3) end = "rd";
scoreCharts.set(scoreIndex + end, scoresSummaries[i].getValue());
}
this.horizontalBarModel.addSeries(scoreCharts);
this.horizontalBarModel.setStacked(false);
this.horizontalBarModel.setShowPointLabels(true);
this.horizontalBarModel.setMouseoverHighlight(true);
this.horizontalBarModel.setShowDatatip(false);
this.horizontalBarModel.setExtender("extender");
if(this.scoresSummaries.length <= 3) this.horizontalBarModel.setBarWidth(30);
this.horizontalBarModel.getAxis(AxisType.Y).setTickAngle(-45);
}
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:50,代码来源:Molecule.java
示例18: generateFragmentsModelView
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
protected boolean generateFragmentsModelView(MetFragResult molecule) {
this.fragmentsModel = new LineChartModel();
this.numberMatchPeaksOfSelectedMolecule = 0;
if(this.processedPeaklistObject == null) {
System.out.println("peaklist object is not initialised");
return false;
}
try {
if(this.processedPeaklistObject == null) throw new Exception();
double maxMZ = ((TandemMassPeak)this.processedPeaklistObject.getElement(this.processedPeaklistObject.getNumberElements() - 1)).getMass();
this.fragmentsModel.getAxis(AxisType.Y).setMin(0);
this.fragmentsModel.getAxis(AxisType.Y).setMax(1050);
this.fragmentsModel.getAxis(AxisType.Y).setLabel("Intensity");
this.fragmentsModel.getAxis(AxisType.Y).setTickInterval("250");
this.fragmentsModel.getAxis(AxisType.Y).setTickCount(5);
this.fragmentsModel.getAxis(AxisType.X).setMin(0.0);
this.fragmentsModel.getAxis(AxisType.X).setLabel("m/z");
this.fragmentsModel.getAxis(AxisType.X).setTickFormat("%.2f");
this.fragmentsModel.getAxis(AxisType.X).setTickAngle(-30);
this.fragmentsModel.setZoom(true);
this.fragmentsModel.setMouseoverHighlight(true);
this.fragmentsModel.setShowDatatip(false);
this.fragmentsModel.setShowPointLabels(false);
this.fragmentsModel.setExtender("fragmentsViewExtender");
String xTickInterval = "100.000";
if(maxMZ <= 400) xTickInterval = "50.000";
if(maxMZ <= 150) xTickInterval = "10.000";
this.fragmentsModel.getAxis(AxisType.X).setTickInterval(xTickInterval);
String seriesColors = "";
java.util.Vector<Integer> explainedPeakIDs = new java.util.Vector<Integer>();
for(int i = 0; i < molecule.getMatchList().getNumberElements(); i++)
explainedPeakIDs.add(molecule.getMatchList().getElement(i).getMatchedPeak().getID());
java.util.Vector<LineChartSeries> nonMatchPeaks = new java.util.Vector<LineChartSeries>();
java.util.Vector<LineChartSeries> nonUsedPeaks = new java.util.Vector<LineChartSeries>();
for(int i = 0; i < this.processedPeaklistObject.getNumberElements(); i++)
{
TandemMassPeak peak = (TandemMassPeak)this.processedPeaklistObject.getElement(i);
LineChartSeries newSeries = new LineChartSeries();
newSeries.set(peak.getMass() + 0.0000001, -10000000.0);
newSeries.set(peak.getMass(), peak.getRelativeIntensity());
int mode = this.beanSettingsContainer.getMode() == 1000 || this.beanSettingsContainer.getMode() == -1000 ? 0 : this.beanSettingsContainer.getMode();
int modeIndex = Constants.ADDUCT_NOMINAL_MASSES.indexOf(mode);
if(explainedPeakIDs.contains(peak.getID())) {
this.numberMatchPeaksOfSelectedMolecule++;
seriesColors += "66cc66,";
this.fragmentsModel.addSeries(newSeries);
}
else if(peak.getMass() > Double.parseDouble(this.beanSettingsContainer.getNeutralMonoisotopicMass()) - 5.0 + Constants.ADDUCT_MASSES.get(modeIndex))
nonUsedPeaks.add(newSeries);
else
nonMatchPeaks.add(newSeries);
}
for(int i = 0; i < nonMatchPeaks.size(); i++) {
seriesColors += "00749f,";
this.fragmentsModel.addSeries(nonMatchPeaks.get(i));
}
for(int i = 0; i < nonUsedPeaks.size(); i++) {
seriesColors += "808080,";
this.fragmentsModel.addSeries(nonUsedPeaks.get(i));
}
seriesColors = seriesColors.substring(0, seriesColors.length() - 1);
this.fragmentsModel.setSeriesColors(seriesColors);
}
catch(Exception e) {
e.printStackTrace();
this.fragmentsModel = new LineChartModel();
return false;
}
return true;
}
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:72,代码来源:MetFragWebBean.java
示例19: generateSpectrumModelView
import org.primefaces.model.chart.AxisType; //导入依赖的package包/类
public boolean generateSpectrumModelView(Messages errorMessages) {
this.spectrumModel = new LineChartModel();
if(this.peakList == null) {
errorMessages.setMessage("peakListInputError", "Error: Peak list required.");
return false;
}
String string = (this.peakList).trim();
try {
if(string.length() == 0) throw new Exception();
this.peaklistObject = this.generatePeakListObject();
double maxMZ = ((TandemMassPeak)this.peaklistObject.getElement(this.peaklistObject.getNumberElements() - 1)).getMass();
this.spectrumModel.getAxis(AxisType.Y).setMin(0);
this.spectrumModel.getAxis(AxisType.Y).setMax(1050);
this.spectrumModel.getAxis(AxisType.Y).setLabel("Intensity");
this.spectrumModel.getAxis(AxisType.Y).setTickInterval("250");
this.spectrumModel.getAxis(AxisType.Y).setTickCount(5);
this.spectrumModel.getAxis(AxisType.X).setMin(0.0);
this.spectrumModel.getAxis(AxisType.X).setTickAngle(-30);
this.spectrumModel.getAxis(AxisType.X).setLabel("m/z");
this.spectrumModel.getAxis(AxisType.X).setTickFormat("%.2f");
this.spectrumModel.setZoom(true);
this.spectrumModel.setMouseoverHighlight(true);
this.spectrumModel.setShowDatatip(false);
this.spectrumModel.setShowPointLabels(false);
this.spectrumModel.setExtender("spectrumViewExtender");
String xTickInterval = "100.000";
if(maxMZ <= 400) xTickInterval = "50.000";
if(maxMZ <= 150) xTickInterval = "10.000";
this.spectrumModel.getAxis(AxisType.X).setTickInterval(xTickInterval);
for(int i = 0; i < this.peaklistObject.getNumberElements(); i++)
{
TandemMassPeak peak = (TandemMassPeak)this.peaklistObject.getElement(i);
LineChartSeries newSeries = new LineChartSeries();
newSeries.set(peak.getMass() + 0.0000001, -10000000.0);
newSeries.set(peak.getMass(), peak.getRelativeIntensity());
this.spectrumModel.addSeries(newSeries);
}
this.spectrumModel.setSeriesColors("00749f");
}
catch(Exception e) {
this.spectrumModel = new LineChartModel();
errorMessages.setMessage("peakListInputError", "Error: Invalid peak list value.");
return false;
}
errorMessages.removeKey("peakListInputError");
return true;
}
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:48,代码来源:BeanSettingsContainer.java
示例20: initLinearPorInsituicao
import org.primefaces.model.chart.AxisType; //导入依赖的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.AxisType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论