swaps
swaps

Reputation: 315

primefaces barchart X axis decimal tick labels with single decimal digit

How can I get decimal tick labels on X axis

the decimal values should have only one decimal digit.

can I achieve it?

please suggest me

thank u

Upvotes: 0

Views: 4105

Answers (1)

Daniel
Daniel

Reputation: 37061

You should use the extender of the <p:barChart , like this:

<p:barChart value="#{myBean.myModel}" widgetVar="myBarChart" extender="my_ext"/>


<script type="text/javascript">
    function my_ext() {
        this.cfg.axes.xaxis.tickOptions = {
            formatString : '%#.1f'
        };
    }
</script>

Upvotes: 2

Related Questions