0
Folks someone knows how to leave the primefaces bar chart this way?
I tried to do here only that it alternates the colors, it leaves for example instead of three columns blue, 1 blue, 1 red, 1 yellow , 1 green and 1 purple.
Code:
void private createBarModels() {
testeGrafico = initBarModel2();
testeGrafico.setTitle("Bar Charts");
testeGrafico.setAnimate(true);
testeGrafico.setLegendPosition("ne");
Axis yAxis = testeGrafico.getAxis(AxisType.Y);
yAxis.setMin(0);
}
private BarChartModel initBarModel2() {
BarChartModel model2 = new BarChartModel();
graficoA = curvaABCDAO.listaClientes();
graficoB = curvaABCDAO.listaClientesB();
ChartSeries t1 = new ChartSeries();
ChartSeries t2 = new ChartSeries();
for (ChamadosEntity tc : graficoA) {
t1.setLabel(tc.getAbc());
t1.set(tc.getSolucao(), tc.getChamados());
}
for (ChamadosEntity tb : graficoB) {
t2.setLabel(tb.getAbc());
t2.set(tb.getSolucao(), tb.getChamados());
}
model2.addSeries(t1);
model2.addSeries(t2);
return model2;
}
Image of the test I took:
puts your code where you create the chart,
– Henrique Santiago
Your image is very confusing. The Barchart of Primefaces works with the series concept, and each series (in this case) would be a column of each part of the graph. In this image of you, each part of the graphic is composed by the whole series.
– Henrique Santiago
Got it, I added where I mount the chart,?
– user86690
I don’t think so.
– Henrique Santiago
blz, I’ll give you one more search, vlw trout.
– user86690