【问题标题】:PrimeFaces Bar Chart FormattingPrimeFaces 条形图格式
【发布时间】:2015-03-25 20:41:54
【问题描述】:

我正在尝试在我的条形图上做两件事:

  1. 将y轴数的格式改为###,###(12000),而不是######(12000);
  2. 更改鼠标 tooltip 以仅显示 y 轴值。 14554 in 而不是 1,14554

我尝试过使用自定义扩展器,但我找不到它的 JPlot 代码。

我正在使用 PrimeFaces 5.1。

【问题讨论】:

    标签: javascript jsf primefaces bar-chart sjplot


    【解决方案1】:

    为了使用 primefaces 条形图实现您想要的效果,请将以下内容添加到您的自定义 jqPlot 扩展器中:

    1. Y axes 数字格式化为###,###(数字分组)

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

      jqPlot 使用单引号(')来格式化数字和数字分组)

    2. 强制tooltip 仅显示yaxis

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多