在primefaces 6.0中,我想通过 Extender (https://www.primefaces.org/docs/guide/primefaces_user_guide_6_0.pdf第93页)自定义图表 代码如下:
<p:chart type="line" model="#{chartViewLine.lineModel1}"/>
和Bean,我设置:
private LineChartModel lineModel1;
...
lineModel1 = initLinearModel();
lineModel1.setExtender("extender"); //this wil custom with js
和脚本:
<script type="text/javascript">
//<![CDATA[
function extender() {
this.cfg.seriesDefaults = {
pointLabels: {show: false}
};
}
//]]>
</script>
但是,什么也没发生。我试过了
<p:chart type="line" model="#{chartViewLine.lineModel1}" widgetVar="test1"/>
function extender() {
this = PF('test1');
this.cfg.seriesDefaults = {
pointLabels: {show: false}
};
} 但还是那样,请帮助我,如何定制它!