主图面x轴 [英] primafaces chart x axis
问题描述
您可以从此网站查看问题。
以下是我的index.html文件的代码:
< h:head><< ; /小时:头>
< h:form>
< p:outputLabel value =Primefaces Tutorial>< / p:outputLabel>
< / h:表格>
< / html>
我在primefaces java中创建图表。 xAxis
重叠。我使用 xaxisAngle
。但它似乎没有区别。任何想法如何解决它?
我想垂直 xAxis
标签。我应该怎么做?
重复引用它在模型中执行的操作。但是,您也可以在JavaScript中执行此操作,但您需要使用扩展程序功能。在这种情况下如何使用它的例子是
JavaScript:
function customExtender(){this.cfg.axes = {xaxis:{renderer:$ .jqplot.DateAxisRenderer,rendererOptions:{tickRenderer:$。 jqplot.CanvasAxisTickRenderer},tickOptions:{formatString:'%b%#d,%H:%M:%S',angle:60}},yaxis:{rendererOptions:{tickRenderer:$ .jqplot.CanvasAxisTickRenderer},tickOptions: {fontSize:'10pt',fontFamily:'Tahoma',angle:30}}};}
b
ManagedBean
barModel.setExtender(customExtender);
You can see the problem from this site.
Here is the code of my index.html file:
<h:head></h:head>
<h:form>
<p:outputLabel value="Primefaces Tutorial"></p:outputLabel>
<p:chart type="bar" model="#{viewEmployeesManagedBean.barModel}" style="height:500px" xaxisAngle="90" />
</h:form>
</html>
I create a chart in primefaces java. xAxis
overlaps. I use xaxisAngle
. But it seems it makes no difference. Any idea how to fix it?
I want vertical xAxis
labels. What should I do?
The duplicate refers to it doing in the model. You can however also do it in javascript but you need to use the extender functionality. An example of how to use this in this case is
JavaScript:
function customExtender() {
this.cfg.axes = {
xaxis : {
renderer : $.jqplot.DateAxisRenderer,
rendererOptions : {
tickRenderer : $.jqplot.CanvasAxisTickRenderer
},
tickOptions : {
formatString : '%b %#d, %H:%M:%S',
angle : 60
}
},
yaxis : {
rendererOptions : {
tickRenderer : $.jqplot.CanvasAxisTickRenderer
},
tickOptions : {
fontSize : '10pt',
fontFamily : 'Tahoma',
angle : 30
}
}
};
}
ManagedBean
barModel.setExtender("customExtender");
这篇关于主图面x轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!