简体   繁体   English

PrimeFaces 条形图格式

[英]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);将y轴数的格式改为###,###(12000)而不是######(12000);
  2. Changing the mouse tooltip to show just the y axis value.更改鼠标tooltip以仅显示 y 轴值。 14554 in instead of 1,14554 14554 英寸而不是 1,14554

I've tried using custom extender, but I couldn't find out the JPlot code to it.我试过使用自定义扩展器,但我找不到它的 JPlot 代码。

I'm using PrimeFaces 5.1.我正在使用 PrimeFaces 5.1。

In order to achieve what you want with your primefaces bar chart, add following to your custom jqPlot extender:为了使用 primefaces 条形图实现您想要的效果,请将以下内容添加到您的自定义jqPlot扩展器中:

  1. To format Y axes numbers as ###,### (digit grouping)Y axes编号格式化为###,### (数字分组)

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

    ( jqPlot uses single quote (') to format number with digit grouping) jqPlot使用单引号 (') 用数字分组来格式化数字)

  2. To force tooltip to show only yaxis values强制tooltip仅显示yaxis

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM