【问题标题】:Primefaces 5.0 Chart CustomizationPrimefaces 5.0 图表定制
【发布时间】:2014-11-04 13:03:32
【问题描述】:

我在创建自定义 p:chart type="pie" 画布时遇到问题。

我必须将饼图的背景颜色从白色更改为另一种颜色。

我几乎尝试了所有我发现的东西。我试图覆盖 Prime Faces 图表类的 css 资源,但它不起作用。它将所有画布/框架变成一种颜色并使图表消失。

.xhtml 文件

<p:chart type="pie"
 model="#{dashboardController.model}"
 style="width:500px;height:250px;  margin: 0 auto;" />

bean.java 文件

model= new PieChartModel();
model.setDataFormat("value");
model.setShowDataLabels(true);
model.setFill(true);
model.setTitle("States");
model.setSeriesColors("62656a,a5a5a5,929397");
model.setShowDataLabels(true);
model.setDiameter(200);

这是我需要更改画布背景的组件。您可以从这里看到相同的图表:http://www.primefaces.org/showcase/ui/chart/pie.xhtml

**如何只更改背景? **

提前致谢。

【问题讨论】:

    标签: css jsf-2 primefaces charts pie-chart


    【解决方案1】:

    更改此类的bg

    .jqplot-series-canvas {
      background:blue;
    }
    

    【讨论】:

    • 我不得不修改.jqplot-series-shadowCanvas,因为整个系列课程都隐藏了我的一些酒吧。
    猜你喜欢
    • 1970-01-01
    • 2014-10-16
    • 1970-01-01
    • 2014-11-19
    • 1970-01-01
    • 2012-12-25
    • 2014-12-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多