在Primefaces 5.2中更改字体大小<p:chart jqplot-xaxis-tick

3

如何更改p:chart bar jqplot-xaxis-tick中的字体大小?我使用Primefaces 5.2并覆盖样式类不起作用。

输入图像描述

1个回答

3

JQPlot表示您可以更改字体大小和字体族: http://www.jqplot.com/examples/rotated-tick-labels.php

因此,在PF中,您可以使用图表扩展功能来实现此目的...

JAVA:

final LineChartModel model = new LineChartModel();
model.setExtender("chartExtender");

JAVASCRIPT:

function chartExtender() {
    this.cfg.axesDefaults = {
    tickOptions: {
      fontFamily: 'Georgia',
      fontSize: '10pt',
      angle: -30
    }
   };
}

感谢您的答复。JavaScript代码应该粘贴在哪里?在外部文件中吗?如何包含到托管bean中? - 4Money
Javascript代码应该放在使用p:chart的XHTML页面中。 - Melloware

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接