Rafael Vamperst
Rafael Vamperst

Reputation: 1

PrimeFaces Bar Chart Formatting

I'm trying to do 2 things on my Bar Chart:

  1. Change the format of the number of yaxis to ###,###(12000) instead of ######(12000);
  2. Changing the mouse tooltip to show just the y axis value. 14554 in instead of 1,14554

I've tried using custom extender, but I couldn't find out the JPlot code to it.

I'm using PrimeFaces 5.1.

Upvotes: 0

Views: 2572

Answers (1)

Dusan Kovacevic
Dusan Kovacevic

Reputation: 1437

In order to achieve what you want with your primefaces bar chart, add following to your custom jqPlot extender:

  1. To format Y axes numbers as ###,### (digit grouping)

    this.cfg.axes.yaxis.tickOptions.formatString = "%'d";

    (jqPlot uses single quote (') to format number with digit grouping)

  2. To force tooltip to show only yaxis values

    this.cfg.highlighter={show: true,tooltipAxes: 'y',useAxesFormatters: false,tooltipFormatString: "%'d"};

Upvotes: 1

Related Questions