0

我正在尝试从此链接实现 Primefaces 图表。

我设法创建了这个例子:

<div id="datachart" style="margin: 0 auto; width:850px; height:400px; position:relative">
    <h:form prependId="false">  
        <p:growl id="growl" showDetail="true" />  

        <p:barChart id="basic" value="#{bean.categoryModel}"   
                    title="Accounts and Groups" min="0" max="#{DashboardController.chartMaxSize}" style="height:400px"
                    shadow="true" barMargin="40" barPadding="90" seriesColors="4D94FF, 1975FF" 
                    yaxisLabel="Size" zoom="true"> 
            <p:ajax event="itemSelect" listener="#{bean.itemSelect}" update="growl" />
        </p:barChart>
    </h:form>
</div>

我创建了这个 css 来更改图表颜色标签:

<style type="text/css">
    .jqplot-title{
        color:#FFFFFF;
    }
    .jqplot-xaxis-label{
        color:#FFFFFF; 
    }
    .jqplot-yaxis-label{
        color:#FFFFFF;
    }
    .jqplot-xaxis-tick{
        color:#FFFFFF;
    }
    jqplot-yaxis-tick{
        color:#FFFFFF;
    }
</style>

但由于某种原因,颜色没有改变。你能帮我找到我缺少的东西吗?

4

1 回答 1

2

尝试使用<f:facet name="last">

<f:facet name="last">
    your css styles goes here
    Or even better drop them into .css file and include it here
</f:facet>

如需进一步参考,请查看此

可定制的资源排序

PrimeFaces 中的资源排序

于 2012-10-23T18:41:38.310 回答