Washington Reis D F
Washington Reis D F

Reputation: 79

Primefaces BarChart label

how I can remove this number that show in my barChart guys? it show "1,2" I want only the number 2.

  private void criarFrequenciaModelBar() {
    frequenciaModelBar = carregarGraficoBarra();
    frequenciaModelBar.setTitle("Frequências por Mês");
    frequenciaModelBar.setLegendPosition("e");
    frequenciaModelBar.setShowPointLabels(true);
    Axis xAxis = frequenciaModelBar.getAxis(AxisType.X);
    xAxis.setLabel(mesNome);
    Axis yAxis = frequenciaModelBar.getAxis(AxisType.Y);        
    Calendar c = Calendar.getInstance();
    c.setTime(new Date());
    yAxis.setLabel(String.valueOf(c.get(Calendar.YEAR)));
    yAxis.setMin(0);
    yAxis.setMax(10);
    yAxis.setTickFormat("%d");
}

here the image

Upvotes: 2

Views: 583

Answers (1)

Washington Reis D F
Washington Reis D F

Reputation: 79

I resolve my problem using it.

add this script in your body page.

  <script>
        function customExtender() {
            this.cfg.highlighter = {
                tooltipAxes: 'y'
            };
        }
    </script>

and then add it in your barChartModel

 frequenciaModelLinha.setExtender("customExtender");

=D

Upvotes: 3

Related Questions