Index: trunk/extensions/SemanticResultFormats/RELEASE-NOTES |
— | — | @@ -6,10 +6,11 @@ |
7 | 7 | |
8 | 8 | * Compatibility with SMW 1.7 and later. |
9 | 9 | * Dropped support for MediaWiki 1.15.x and SMW < 1.7. |
10 | | -* Added warning icon with tooltip to jqplotpie shown when there are no results instead of a non-working chart. |
| 10 | +* Added warning message to jqplotpie and jqplotbar shown when there are no results instead of a non-working chart. |
11 | 11 | * Added value distribution support to jqplotpie and jqplotbar. |
12 | 12 | * Added min parameter to jqplotbar to set the minimun value for the Y-axis. |
13 | | -* Added pointlabel parameter to jqplotbar, based on a patch by James Hong Kong. |
| 13 | +* Added pointlabel parameter to jqplotbar and chartlegend, legendlocation, |
| 14 | + datalabels and datalabeltype parameters to jqplotpie based on a patches by James Hong Kong. |
14 | 15 | |
15 | 16 | New formats in this version are: |
16 | 17 | * valuerank (written by DaSch) |
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php |
— | — | @@ -79,6 +79,10 @@ |
80 | 80 | 'srf_paramdesc_barnumbersaxislabel' => 'The label for the numbers axis', |
81 | 81 | 'srf-paramdesc-minvalue' => 'The minimum value to show on the Y-axis', |
82 | 82 | 'srf-paramdesc-pointlabels' => 'Display of individual data points', |
| 83 | + 'srf-paramdesc-chartlegend' => 'Display chart legend', |
| 84 | + 'srf-paramdesc-legendlocation' => 'Set legend location', |
| 85 | + 'srf-paramdesc-datalabels' => 'Display pie data labels', |
| 86 | + 'srf-paramdesc-datalabeltype' => 'Set data label type', |
83 | 87 | |
84 | 88 | // "gallery" format |
85 | 89 | 'srf_printername_gallery' => 'Gallery', |
Index: trunk/extensions/SemanticResultFormats/jqPlot/SRF_jqPlotPie.php |
— | — | @@ -123,6 +123,11 @@ |
124 | 124 | |
125 | 125 | self::$m_piechartnum++; |
126 | 126 | |
| 127 | + $chartlegend = FormatJson::encode( $this->params['chartlegend'] ); |
| 128 | + $legendlocation = FormatJson::encode( $this->params['legendlocation'] ); |
| 129 | + $datalabels = FormatJson::encode( $this->params['datalabels'] ); |
| 130 | + $datalabeltype = FormatJson::encode( $this->params['datalabeltype'] ); |
| 131 | + |
127 | 132 | $js_pie =<<<END |
128 | 133 | <script type="text/javascript"> |
129 | 134 | jQuery(document).ready(function(){ |
— | — | @@ -132,10 +137,12 @@ |
133 | 138 | seriesDefaults: { |
134 | 139 | renderer: jQuery.jqplot.PieRenderer, |
135 | 140 | rendererOptions: { |
| 141 | + showDataLabels: $datalabels, |
| 142 | + dataLabels: $datalabeltype, |
136 | 143 | sliceMargin:2 |
137 | 144 | } |
138 | 145 | }, |
139 | | - legend: { show:true } |
| 146 | + legend: { show:$chartlegend, location: $legendlocation } |
140 | 147 | }); |
141 | 148 | }); |
142 | 149 | </script> |
— | — | @@ -171,7 +178,22 @@ |
172 | 179 | $params['charttitle']->setMessage( 'srf_paramdesc_charttitle' ); |
173 | 180 | |
174 | 181 | $params['distributionlimit']->setDefault( 13 ); |
| 182 | + |
| 183 | + $params['chartlegend'] = new Parameter( 'chartlegend', Parameter::TYPE_BOOLEAN, true ); |
| 184 | + $params['chartlegend']->setMessage( 'srf-paramdesc-chartlegend' ); |
| 185 | + |
| 186 | + $params['legendlocation'] = new Parameter( 'legendlocation', Parameter::TYPE_STRING, 'ne' ); |
| 187 | + $params['legendlocation']->setMessage( 'srf-paramdesc-legendlocation' ); |
| 188 | + $params['legendlocation']->addCriteria( new CriterionInArray( 'nw','n', 'ne', 'e', 'se', 's', 'sw', 'w' ) ); |
| 189 | + |
| 190 | + $params['datalabels'] = new Parameter( 'datalabels', Parameter::TYPE_BOOLEAN, false ); |
| 191 | + $params['datalabels']->setMessage( 'srf-paramdesc-datalabels' ); |
| 192 | + |
| 193 | + $params['datalabeltype'] = new Parameter( 'datalabeltype', Parameter::TYPE_STRING, ' ' ); |
| 194 | + $params['datalabeltype']->setMessage( 'srf-paramdesc-datalabeltype' ); |
| 195 | + $params['datalabeltype']->addCriteria( new CriterionInArray( 'percent','value', 'label' ) ); |
175 | 196 | |
| 197 | + |
176 | 198 | return $params; |
177 | 199 | } |
178 | 200 | |