Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | * Dropped support for MediaWiki 1.15.x and SMW < 1.7. |
10 | 10 | * Added warning icon with tooltip to jqplotpie shown when there are no results instead of a non-working chart. |
11 | 11 | * Added value distribution support to jqplotpie and jqplotbar. |
| 12 | +* Added min parameter to jqplotbar to set the minimun value for the Y-axis. |
12 | 13 | |
13 | 14 | New formats in this version are: |
14 | 15 | * valuerank (written by DaSch) |
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | 'srf_paramdesc_barcolor' => 'The color of the bars', |
79 | 79 | 'srf_paramdesc_bardirection'=> 'The direction of the bar chart', |
80 | 80 | 'srf_paramdesc_barnumbersaxislabel' => 'The label for the numbers axis', |
81 | | - 'srf-paramdesc-distribution' => 'If the distribution of results should be calculated and shown.', |
| 81 | + 'srf-paramdesc-minvalue' => 'The minimun value to show on the Y-axis', |
82 | 82 | |
83 | 83 | // "gallery" format |
84 | 84 | 'srf_printername_gallery' => 'Gallery', |
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotBar.php |
— | — | @@ -130,8 +130,14 @@ |
131 | 131 | $this->isHTML = true; |
132 | 132 | |
133 | 133 | $maxValue = count( $data ) == 0 ? 0 : max( $data ); |
134 | | - $minValue = count( $data ) == 0 ? 0 : min( $data ); |
135 | 134 | |
| 135 | + if ( $this->params['min'] === false ) { |
| 136 | + $minValue = count( $data ) == 0 ? 0 : min( $data ); |
| 137 | + } |
| 138 | + else { |
| 139 | + $minValue = $this->params['min']; |
| 140 | + } |
| 141 | + |
136 | 142 | foreach ( $data as $i => &$nr ) { |
137 | 143 | if ( $this->m_bardirection == 'horizontal' ) { |
138 | 144 | $nr = array( $nr, $i ); |
— | — | @@ -274,6 +280,10 @@ |
275 | 281 | $params['numbersaxislabel'] = new Parameter( 'numbersaxislabel', Parameter::TYPE_STRING, ' ' ); |
276 | 282 | $params['numbersaxislabel']->setMessage( 'srf_paramdesc_barnumbersaxislabel' ); |
277 | 283 | |
| 284 | + $params['min'] = new Parameter( 'min', Parameter::TYPE_INTEGER ); |
| 285 | + $params['min']->setMessage( 'srf-paramdesc-minvalue' ); |
| 286 | + $params['min']->setDefault( false, false ); |
| 287 | + |
278 | 288 | return $params; |
279 | 289 | } |
280 | 290 | |