Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
666 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...