Fix marginWithDeadline chart.

* Add fixed bounds to range axis.
* Set series color.
* Adjust chart width.

FEA: ItEr75S27PerProjectDashboard
This commit is contained in:
Nacho Barrientos 2011-11-22 18:01:02 +01:00 committed by Manuel Rego Casasnovas
parent 289475cbf7
commit 07667fd294
2 changed files with 14 additions and 1 deletions

View file

@ -23,6 +23,7 @@ import static org.libreplan.web.I18nHelper._;
import java.awt.Color;
import java.awt.Font;
import java.math.BigDecimal;
import java.util.Iterator;
import java.util.List;
@ -105,6 +106,18 @@ public class DashboardController extends GenericForwardComposer {
private void generateTimeKPImarginWithDeadlineChart() {
CategoryModel categoryModel;
categoryModel = refreshTimeKPImarginWithDeadlineCategoryModel();
timeKPImarginWithDeadlineChart.setAttribute("range-axis-lower-bound",
new Double(-3.0));
timeKPImarginWithDeadlineChart.setAttribute("range-axis-upper-bound",
new Double(3.0));
Color[] seriesColorMappings = new Color[1];
if(dashboardModel.getMarginWithDeadLine().compareTo(BigDecimal.ZERO) >= 0) {
seriesColorMappings[0] = Color.GREEN;
} else {
seriesColorMappings[0] = Color.RED;
}
timeKPImarginWithDeadlineChart.setAttribute("series-color-mappings",
seriesColorMappings);
timeKPImarginWithDeadlineChart.setModel(categoryModel);
}

View file

@ -55,7 +55,7 @@
paneColor="#FFFFFF" bgColor="#FFFFFF"
showLegend="true" showTooltiptext="true" />
<chart id="timeKPImarginWithDeadlineChart"
height="400px" width="600px" type="bar"
height="400px" width="250px" type="bar"
threeD="true" yAxis="x D days" orient="vertical"
title="${i18n:_('Margin with deadline')}"
paneColor="#FFFFFF" showLegend="false" />