I have a JSF line chart that uses PrimeFaces. I want to add labels to both x-axis & y-axis eg Year & Populations. I have used showLabel:true but its not working.The is code,
<p:lineChart id="chart" value="#{chartBean.linearModel}" xaxisAngle="-90">
<f:convertDateTime pattern="d-M-yyyy"/>
</p:lineChart>
function phaseChartExt() {
this.cfg.axes = {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
rendererOptions: { tickRenderer: $.jqplot.CanvasAxisTickRenderer },
tickOptions: {
showLabel:true,
showGridline: true,
formatString: '%H:%M',
angle: -90
}
}
yaxis: {
renderer: $.jqplot.DateAxisRenderer,
rendererOptions: { tickRenderer: $.jqplot.CanvasAxisTickRenderer },
tickOptions: {
showLabel:true,
showGridline: true,
formatString: '%H:%M',
angle: -90
}
}
}
}
Try to use
xaxisLabel="Year" yaxisLabel="Populations"
<p:lineChart id="chart" value="#{chartBean.linearModel}" xaxisAngle="-90" xaxisLabel="Year" yaxisLabel="Populations">
<f:convertDateTime pattern="d-M-yyyy"/>
</p:lineChart>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments