← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5522: Removed chart size property

 

------------------------------------------------------------
revno: 5522
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-12-21 12:19:47 +0100
message:
  Removed chart size property
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  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/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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-12-19 11:22:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-12-21 11:19:47 +0000
@@ -76,10 +76,6 @@
     public static final String TYPE_LINE3D = "line3d";
     public static final String TYPE_PIE3D = "pie3d";
 
-    public static final String SIZE_NORMAL = "normal";
-    public static final String SIZE_WIDE = "wide";
-    public static final String SIZE_TALL = "tall";
-
     public static final String TYPE_COLUMN = "column";
     public static final String TYPE_STACKED_COLUMN = "stackedColumn";
     public static final String TYPE_BAR = "bar";
@@ -271,12 +267,12 @@
 
     public int getWidth()
     {
-        return isSize( SIZE_WIDE ) ? 1000 : 700;
+        return 700;
     }
 
     public int getHeight()
     {
-        return isSize( SIZE_TALL ) ? 800 : 500;
+        return 500;
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-12-19 19:04:38 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-12-21 11:19:47 +0000
@@ -263,6 +263,7 @@
         executeSql( "ALTER TABLE chart DROP COLUMN individualquartersthisyear" );
         executeSql( "ALTER TABLE chart RENAME COLUMN title TO name" );
         executeSql( "ALTER TABLE chart ALTER COLUMN dimension DROP NOT NULL" );
+        executeSql( "ALTER TABLE chart DROP COLUMN size" );
 
         executeSql( "ALTER TABLE datamartexport DROP COLUMN last3months" );
         executeSql( "ALTER TABLE datamartexport DROP COLUMN last6months" );

=== 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-12-15 19:02:36 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-12-21 11:19:47 +0000
@@ -240,7 +240,6 @@
         }
 
         chart.setType( TYPE_LINE );
-        chart.setSize( SIZE_NORMAL );
         chart.setDimension( DIMENSION_PERIOD_INDICATOR );
         chart.setHideLegend( true );
         chart.setVerticalLabels( true );
@@ -268,7 +267,6 @@
         }
 
         chart.setType( TYPE_BAR );
-        chart.setSize( SIZE_NORMAL );
         chart.setDimension( DIMENSION_ORGANISATIONUNIT_INDICATOR );
         chart.setHideLegend( true );
         chart.setVerticalLabels( true );
@@ -302,7 +300,6 @@
         }
 
         chart.setType( TYPE_BAR );
-        chart.setSize( SIZE_NORMAL );
         chart.setDimension( dimension );
         chart.setHideLegend( false );
         chart.setVerticalLabels( true );

=== 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-12-15 11:07:16 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-12-21 11:19:47 +0000
@@ -21,8 +21,6 @@
 
     <property name="type" />
 
-    <property name="size" />
-
     <property name="dimension" />
 
     <property name="series" />

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-12-19 19:58:47 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-12-21 11:19:47 +0000
@@ -33,6 +33,7 @@
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.chart.ChartService;
 import org.hisp.dhis.dataelement.DataElement;
@@ -149,13 +150,6 @@
         this.type = type;
     }
 
-    private String size;
-
-    public void setSize( String size )
-    {
-        this.size = size;
-    }
-
     private String dimension;
 
     public void setDimension( String dimension )
@@ -361,11 +355,10 @@
         Collections.sort( periods, new AscendingPeriodComparator() );
 
         chart.setName( name );
-        chart.setDomainAxixLabel( domainAxisLabel );
-        chart.setRangeAxisLabel( rangeAxisLabel );
+        chart.setDomainAxixLabel( StringUtils.trimToNull( domainAxisLabel ) );
+        chart.setRangeAxisLabel( StringUtils.trimToNull( rangeAxisLabel ) );
         chart.setHideSubtitle( hideSubtitle );
         chart.setType( type );
-        chart.setSize( size );
         chart.setDimension( dimension );
         chart.setHideLegend( hideLegend );
         chart.setVerticalLabels( verticalLabels );
@@ -373,7 +366,7 @@
         chart.setRegression( regression );
         chart.setTargetLine( targetLine );
         chart.setTargetLineValue( targetLineValue );
-        chart.setTargetLineLabel( targetLineLabel );
+        chart.setTargetLineLabel( StringUtils.trimToNull( targetLineLabel ) );
         chart.setUserOrganisationUnit( userOrganisationUnit );
         chart.setIndicators( indicators );
         chart.setDataElements( dataElements );

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm	2011-11-21 12:44:20 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartForm.vm	2011-12-21 11:19:47 +0000
@@ -92,16 +92,6 @@
 	    </td>
     </tr>
     <tr>
-        <td><label for="type">$i18n.getString( "chart_size" )</label></td>
-        <td>
-            <select id="size" name="size" style="width:300px">
-                <option value="normal"#if ( $!chart.size == "normal" ) selected#end>$i18n.getString( "normal" )</option>
-                <option value="wide"#if ( $!chart.size == "wide" ) selected#end>$i18n.getString( "wide" )</option>
-                <option value="tall"#if ( $!chart.size == "tall" ) selected#end>$i18n.getString( "tall" )</option>
-            </select>
-        </td>
-    </tr>
-    <tr>
     	<td><label for="hideLegend">$i18n.getString( "hide_legend" )</label></td>
     	<td><input type="checkbox" id="hideLegend" name="hideLegend" value="true"#if( $!chart.hideLegend ) checked#end></td>
     </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js	2011-11-21 12:44:20 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/chart.js	2011-12-21 11:19:47 +0000
@@ -2,17 +2,14 @@
 // View chart
 // -----------------------------------------------------------------------------
 
-function viewChart( url, size )
+function viewChart( url )
 {
-    var width = size === 'wide' ? 1000 : 700;
-    var height = size === 'tall' ? 800 : 500;
-
     $( '#chartImage' ).attr( 'src', url );
     $( '#chartView' ).dialog( {
         autoOpen : true,
         modal : true,
-        height : height + 65,
-        width : width + 45,
+        height : 565,
+        width : 745,
         resizable : false,
         title : 'Viewing Chart'
     } );

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm	2011-11-21 12:44:20 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewChartForm.vm	2011-12-21 11:19:47 +0000
@@ -26,16 +26,13 @@
                     	<select id="chart_type">
                     		<option value='indicator'>$i18n.getString( 'indicator_by_period_chart' )</option>
                     		<option value='organisationUnit'>$i18n.getString( 'indicator_by_organisation_unit_chart' )</option>
-
                     		<option value='dataElement_period'>$i18n.getString( 'dataelement_by_period_chart' )</option>
                     		<option value='organisationUnit_dataElement'>$i18n.getString( 'dataelement_by_organisation_unit_chart' )</option>
-
-                    		<option value='completeness_period'>$i18n.getString( 'completeness_by_period_chart' )</option>
-                    		<option value='organisationUnit_completeness'>$i18n.getString( 'completeness_by_organisation_unit_chart' )</option>
-
+                    		<option value='completeness_period'>$i18n.getString( 'completeness_by_period_chart' )</option>                    		
+                    		##<option value='organisationUnit_completeness'>$i18n.getString( 'completeness_by_organisation_unit_chart' )</option>
                     		<option value='period'>$i18n.getString( 'period_by_indicator_chart' )</option>
                     		<option value='period_dataElement'>$i18n.getString( 'period_by_dataelement_chart' )</option>
-                    		<option value='period_completeness'>$i18n.getString( 'period_by_completeness_chart' )</option>
+                    		##<option value='period_completeness'>$i18n.getString( 'period_by_completeness_chart' )</option>
                     	</select>
                     	<button type="button" id="add_chart">$i18n.getString( 'add' )</button>
                     </td>
@@ -55,7 +52,7 @@
                 <tr id="tr${chart.id}">
                     <td onclick="showChartDetails( $chart.id )">$encoder.htmlEncode( $chart.name )</td>
                     <td style="text-align:right">
-						<a href="javascript:viewChart( 'viewChart.action?id=$chart.id', '$chart.size' )" title="$i18n.getString( "view_chart" )"><img src="../images/start_process.png" alt="$i18n.getString( "view_chart" )"></a>
+						<a href="javascript:viewChart( 'viewChart.action?id=$chart.id' )" title="$i18n.getString( "view_chart" )"><img src="../images/start_process.png" alt="$i18n.getString( "view_chart" )"></a>
 						<a href="displayAddChartForm.action?id=$chart.id&dimension=$chart.dimension" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a>
 						#if( $auth.hasAccess( "dhis-web-reporting", "removeChart" ) )
 						<a href="javascript:removeChart( $chart.id, '$encoder.jsEncode( $chart.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>