如何添加Primefaces图表的标签



我有一个使用PrimeFaces的JSF折线图。我想在两个x轴上都添加标签&y轴eg年&人群。我已经使用showLabel:true,但它不工作。代码

   <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                        
                }         
    }
         }
}

尝试使用

xaxisLabel = "年" yaxisLabel ="人口"

 <p:lineChart id="chart" value="#{chartBean.linearModel}" xaxisAngle="-90" xaxisLabel="Year" yaxisLabel="Populations">
       <f:convertDateTime pattern="d-M-yyyy"/>
    </p:lineChart>

相关内容

  • 没有找到相关文章

最新更新