3
이 Primefaces 차트를 개선하는 방법에 대해 몇 가지 질문이 있습니다. I 차트 크기의 색상을 변경하는 방법을Primeface 차트에서 색상을 변경하는 방법은 무엇입니까?
이<h:form>
<p:barChart id="basic" value="#{DashboardController.categoryModel}" legendPosition="ne"
title="Accounts and Groups" min="0" max="200" style="height:400px"
shadow="true" barPadding="60"/>
</h:form>
import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.ChartSeries;
@Named("DashboardController")
@SessionScoped
public class Dashboard implements Serializable
{
/*
* Call the Oracle JDBC Connection driver
*/
@Resource(name = "jdbc/Oracle")
private DataSource ds;
private CartesianChartModel categoryModel;
public Dashboard()
{
createCategoryModel();
}
public CartesianChartModel getCategoryModel()
{
return categoryModel;
}
private void createCategoryModel()
{
categoryModel = new CartesianChartModel();
// Active Accounts
ChartSeries ActiveAccounts = new ChartSeries();
ActiveAccounts.setLabel("Active Accounts");
ActiveAccounts.set("Active Accounts", 120);
categoryModel.addSeries(ActiveAccounts);
// Blocked Accounts
ChartSeries BlockedAccounts = new ChartSeries();
BlockedAccounts.setLabel("Blocked Accounts");
BlockedAccounts.set("Blocked Accounts", 120);
categoryModel.addSeries(BlockedAccounts);
// Active Groups
ChartSeries ActiveGroups = new ChartSeries();
ActiveGroups.setLabel("Active Groups");
ActiveGroups.set("Active Groups", 120);
categoryModel.addSeries(ActiveGroups);
// Blocked Groups
ChartSeries BlockedGroups = new ChartSeries();
BlockedGroups.setLabel("Blocked Groups");
BlockedGroups.set("Blocked Groups", 120);
categoryModel.addSeries(BlockedGroups);
}
}
당신이 말해 줄 수, 또한 "계정 및 그룹"의 색상 :
이 소스 코드인가? 또한 모든 열 아래에 이름을 어떻게 추가 할 수 있는지 묻고 싶습니다. 이제 나는 "Active Accounts"라는 이름 하나만 가지고 있습니다. 개별적으로 열의 이름을 지정하고 싶습니다.
보다도 내가 JSF 헤더에이 코드를 테스트
PS 소원하지만 작동하지 않습니다 : 오직 차트의 레이블을 변경
<script type="text/css">
.jqplot-title{
color:red;
}
</script>
PS 2
2를 시도'