![](/img/trans.png)
[英]How to remove a specific (bottom) border from p:row in p:panelGrid?
[英]Remove grid and border from p:chart barchart
我正在尝试删除我的Primefaces图表中的网格和边框。 请考虑一下新的素数图表。 我在Google上搜索了很多,只找到了解决旧字体标签的方法,但有新方法。
<p:chart type="bar" model="#{reportServerController.horizontalBarModelG}" styleClass="chartSize" >
<p:ajax event="itemSelect" listener="#{auftragBean.itemSelectGutachten}" update="dataTableG" />
</p:chart>
那么有可能从图表中删除边框和网格吗?
要扩展jqplot配置,您必须使用primefaces图表的扩展器功能。
在控制器中,您必须为模型设置属性扩展器。 例如,使用primefaces展示演示:
private BarChartModel initBarModel() {
BarChartModel model = new BarChartModel();
model.setExtender("chartExtender");
ChartSeries boys = new ChartSeries();
boys.setLabel("Boys");
boys.set("2004", 120);
boys.set("2005", 100);
boys.set("2006", 44);
boys.set("2007", 150);
boys.set("2008", 25);
ChartSeries girls = new ChartSeries();
girls.setLabel("Girls");
girls.set("2004", 52);
girls.set("2005", 60);
girls.set("2006", 110);
girls.set("2007", 135);
girls.set("2008", 120);
model.addSeries(boys);
model.addSeries(girls);
return model;
}
setExtender方法接受一个javascript函数的名称,您可以在其中操纵jqplot配置。
例如,要删除网格线,您可以执行以下操作:
<h:outputScript>
function chartExtender(){
//this = chart widget instance
//this.cfg = options
this.cfg.axes.xaxis.tickOptions.showGridline = false;
this.cfg.axes.yaxis.tickOptions.showGridline = false;
}
</h:outputScript>
您可以在此处查看所有jqplot选项
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.