=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java 2011-09-05 17:12:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java 2011-09-07 13:14:46 +0000
@@ -86,6 +86,10 @@
private int id;
private String title;
+
+ private String domainAxixLabel;
+
+ private String rangeAxisLabel;
private String type;
@@ -330,6 +334,26 @@
this.title = title;
}
+ public String getDomainAxixLabel()
+ {
+ return domainAxixLabel;
+ }
+
+ public void setDomainAxixLabel( String domainAxixLabel )
+ {
+ this.domainAxixLabel = domainAxixLabel;
+ }
+
+ public String getRangeAxisLabel()
+ {
+ return rangeAxisLabel;
+ }
+
+ public void setRangeAxisLabel( String rangeAxisLabel )
+ {
+ this.rangeAxisLabel = rangeAxisLabel;
+ }
+
public String getType()
{
return type;
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java 2011-09-05 21:57:06 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java 2011-09-07 13:14:46 +0000
@@ -92,6 +92,7 @@
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.DatasetRenderingOrder;
@@ -651,6 +652,10 @@
CategoryAxis xAxis = plot.getDomainAxis();
xAxis.setCategoryLabelPositions( chart.isVerticalLabels() ? CategoryLabelPositions.UP_45
: CategoryLabelPositions.STANDARD );
+ xAxis.setLabel( chart.getDomainAxixLabel() );
+
+ ValueAxis yAxis = plot.getRangeAxis();
+ yAxis.setLabel( chart.getRangeAxisLabel() );
// ---------------------------------------------------------------------
// Color & antialias
@@ -672,12 +677,12 @@
if ( chart.isType( TYPE_STACKED_BAR ) )
{
stackedBarChart = ChartFactory.createStackedBarChart( chart.getTitle(),
- null, null, dataSet, orientation, true, false, false );
+ chart.getDomainAxixLabel(), chart.getRangeAxisLabel(), dataSet, orientation, true, false, false );
}
else
{
stackedBarChart = ChartFactory.createStackedBarChart3D( chart.getTitle(),
- null, null, dataSet, orientation, true, false, false );
+ chart.getDomainAxixLabel(), chart.getRangeAxisLabel(), dataSet, orientation, true, false, false );
}
CategoryPlot plot = (CategoryPlot) stackedBarChart.getPlot();
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml 2011-07-21 03:29:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml 2011-09-07 13:14:46 +0000
@@ -14,6 +14,10 @@