What is the alternative for the chart extender attribute in PrimeFaces 5.2 and newer

时光怂恿深爱的人放手 提交于 2019-11-26 14:49:06

问题


I'm using primefaces 5.2 latest version and tried for line chart, it's working fine.

Am trying to change the line chart axes color,background,border, etc. but extender attribute is not working in latest primefaces version.

My XHTML:

 <p:chart type="line" model="#{chartViewLine.lineModel1}" styleClass="legendpos" extender="chartExtender" style="height:300px; width:570px;"/>

JAVASCRIPT:

function chartExtender() {        
    this.cfg.grid = {             
    background: 'transparent',
    gridLineColor: '#303030',
    drawBorder: false,
};

Is any alternative for 'extender' attribute OR my code have any wrong syntax?


回答1:


You should now set your extender from your model in your chartViewLine bean.

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

Attribute extender has been removed in PrimeFaces 5.0 (see also list of p:chart attributes from PrimeFaces 5.0 Documentation)



来源:https://stackoverflow.com/questions/30644676/what-is-the-alternative-for-the-chart-extender-attribute-in-primefaces-5-2-and-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!