|
5 | 5 | <ModulePrefs
|
6 | 6 | title="Multi Filter Chart.js"
|
7 | 7 | directory_title="Multi Filter Chart.js Gadget"
|
8 |
| - description="Displays various graphs based on multiple filters." |
9 |
| - thumbnail='#staticResourceUrl("org.andnyb.jira.plugin.chartjs-multi-filter:mfgg", "thumbnail.png")'> |
| 8 | + description="Include multiple filters in various Chart.js based and interactive charts." |
| 9 | + thumbnail='#staticResourceUrl("org.andnyb.jira.plugin.chartjs-multi-filter:chartjs-multi-filter", "thumbnail.png")'> |
10 | 10 |
|
11 | 11 | <Require feature="dynamic-height" />
|
12 | 12 | <Optional feature="auth-refresh"/>
|
|
19 | 19 | <Param name="categories">Other</Param>
|
20 | 20 | </Optional>
|
21 | 21 | #oauth
|
22 |
| - #supportedLocales("gadget.common,com.andnyb.jira.plugin.mfgg") |
| 22 | + #supportedLocales("gadget.common,com.andnyb.jira.plugin.chartjs-multi-filter") |
23 | 23 | #supportLocales
|
24 | 24 | </ModulePrefs>
|
25 | 25 |
|
|
49 | 49 |
|
50 | 50 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js"></script>
|
51 | 51 | <canvas id="chart" height="2" width="3"/>
|
| 52 | + <!--script src="js/mfgg.js" type="text/javascript"></script--> |
52 | 53 | <script>
|
53 | 54 | var dataSet = {};
|
54 | 55 | (function () {
|
|
176 | 177 | {
|
177 | 178 | id: "filterIdField",
|
178 | 179 | userpref: "filterIdUserPref",
|
179 |
| - label: "Filter id:", |
| 180 | + label: "Filter id(s):", |
180 | 181 | required: "true",
|
181 |
| - description: "Comma separated list of filter ids for the issues to display in the graph. Check the browser console log for errors when saving, configuration will not be saved if there are invalid filters.", |
| 182 | + description: "Comma separated list of filter ids for the issues to display in the graph. Filter ids are present in the browser URL when selected on the issue search page. Check the browser console log for errors if it not possible to save, configuration will not be saved if there are invalid filters.", |
182 | 183 | type: "number text",
|
183 | 184 | value: gadget.getPref("filterIdUserPref")
|
184 | 185 | },
|
185 | 186 | {
|
186 | 187 | userpref: "graphLabelUserPref",
|
187 |
| - label: "Graph labels:", |
| 188 | + label: "Graph label(s):", |
188 | 189 | description: "Comma separated list of labels to use for the plotted graph.",
|
189 | 190 | type: "text",
|
190 | 191 | value: gadget.getPref("graphLabelUserPref")
|
191 | 192 | },
|
192 |
| - AJS.gadget.fields.nowConfigured() |
| 193 | + AJS.gadget.fields.nowConfigured() |
193 | 194 | ]
|
194 | 195 | };
|
195 | 196 | }, // -> descriptor
|
|
203 | 204 | var g = this;
|
204 | 205 | var optionsDef;
|
205 | 206 | if (g.getPref("barTypeUserPref")=="line" ||
|
206 |
| - g.getPref("barTypeUserPref")=="bar") { |
| 207 | + g.getPref("barTypeUserPref")=="bar") { |
207 | 208 | optionsDef =
|
208 |
| - { |
209 |
| - responsive: true, |
210 |
| - layout: { |
211 |
| - padding: { |
212 |
| - left: 25, |
213 |
| - right: 25, |
214 |
| - top: 0, |
215 |
| - bottom: 0 |
216 |
| - } |
217 |
| - }, |
218 |
| - scales: { |
219 |
| - yAxes: [ |
220 |
| - { |
221 |
| - ticks: { |
222 |
| - beginAtZero: true |
| 209 | + { |
| 210 | + responsive: true, |
| 211 | + layout: { |
| 212 | + padding: { |
| 213 | + left: 25, |
| 214 | + right: 25, |
| 215 | + top: 0, |
| 216 | + bottom: 0 |
| 217 | + } |
| 218 | + }, |
| 219 | + scales: { |
| 220 | + yAxes: [ |
| 221 | + { |
| 222 | + ticks: { |
| 223 | + beginAtZero: true |
| 224 | + } |
223 | 225 | }
|
| 226 | + ] |
| 227 | + }, |
| 228 | + elements: { |
| 229 | + point: { |
| 230 | + radius: 2, |
| 231 | + hoverRadius: 3 |
224 | 232 | }
|
225 |
| - ] |
226 |
| - } |
227 |
| - }; |
| 233 | + } |
| 234 | + }; |
228 | 235 | }
|
229 | 236 | else if (g.getPref("barTypeUserPref")=="doughnut" ||
|
230 |
| - g.getPref("barTypeUserPref")=="pie") { |
| 237 | + g.getPref("barTypeUserPref")=="pie") { |
231 | 238 | optionsDef =
|
232 |
| - { |
233 |
| - responsive: true, |
234 |
| - layout: { |
235 |
| - padding: { |
236 |
| - left: 25, |
237 |
| - right: 25, |
238 |
| - top: 0, |
239 |
| - bottom: 0 |
| 239 | + { |
| 240 | + responsive: true, |
| 241 | + layout: { |
| 242 | + padding: { |
| 243 | + left: 25, |
| 244 | + right: 25, |
| 245 | + top: 0, |
| 246 | + bottom: 0 |
| 247 | + } |
240 | 248 | }
|
241 |
| - } |
242 |
| - }; |
| 249 | + }; |
243 | 250 | }
|
244 | 251 | else if (g.getPref("barTypeUserPref")=="horizontalBar") {
|
245 | 252 | optionsDef =
|
246 |
| - { |
247 |
| - responsive: true, |
248 |
| - layout: { |
249 |
| - padding: { |
250 |
| - left: 25, |
251 |
| - right: 25, |
252 |
| - top: 0, |
253 |
| - bottom: 0 |
254 |
| - } |
255 |
| - }, |
256 |
| - scales: { |
257 |
| - xAxes: [ |
258 |
| - { |
259 |
| - ticks: { |
260 |
| - beginAtZero: true |
261 |
| - } |
| 253 | + { |
| 254 | + responsive: true, |
| 255 | + layout: { |
| 256 | + padding: { |
| 257 | + left: 25, |
| 258 | + right: 25, |
| 259 | + top: 0, |
| 260 | + bottom: 0 |
262 | 261 | }
|
263 |
| - ] |
264 |
| - } |
265 |
| - }; |
| 262 | + }, |
| 263 | + scales: { |
| 264 | + xAxes: [ |
| 265 | + { |
| 266 | + ticks: { |
| 267 | + beginAtZero: true |
| 268 | + } |
| 269 | + } |
| 270 | + ] |
| 271 | + } |
| 272 | + }; |
266 | 273 | }
|
267 | 274 | else if (g.getPref("barTypeUserPref")=="stacked") {
|
268 | 275 | optionsDef =
|
269 |
| - { |
270 |
| - responsive: true, |
271 |
| - layout: { |
272 |
| - padding: { |
273 |
| - left: 25, |
274 |
| - right: 25, |
275 |
| - top: 0, |
276 |
| - bottom: 0 |
277 |
| - } |
278 |
| - }, |
279 |
| - scales: { |
280 |
| - xAxes: [ |
281 |
| - { |
282 |
| - ticks: { |
283 |
| - beginAtZero: true |
284 |
| - }, |
285 |
| - stacked: true |
286 |
| - } |
287 |
| - ], |
288 |
| - yAxes: [ |
289 |
| - { |
290 |
| - stacked: true |
| 276 | + { |
| 277 | + responsive: true, |
| 278 | + layout: { |
| 279 | + padding: { |
| 280 | + left: 25, |
| 281 | + right: 25, |
| 282 | + top: 0, |
| 283 | + bottom: 0 |
291 | 284 | }
|
292 |
| - ] |
293 |
| - } |
294 |
| - }; |
| 285 | + }, |
| 286 | + scales: { |
| 287 | + xAxes: [ |
| 288 | + { |
| 289 | + ticks: { |
| 290 | + beginAtZero: true |
| 291 | + }, |
| 292 | + stacked: true |
| 293 | + } |
| 294 | + ], |
| 295 | + yAxes: [ |
| 296 | + { |
| 297 | + stacked: true |
| 298 | + } |
| 299 | + ] |
| 300 | + } |
| 301 | + }; |
295 | 302 |
|
296 | 303 | }
|
297 | 304 | var barType = g.getPref("barTypeUserPref");
|
|
332 | 339 | return {
|
333 | 340 | contentType: "application/json",
|
334 | 341 | url: "/rest/multifilter/1.0/data"
|
335 |
| - +"?filters="+encodeURIComponent(this.getPref("filterIdUserPref")) |
336 |
| - +"&labels="+encodeURIComponent(this.getPref("graphLabelUserPref")) |
337 |
| - +"&granularity="+this.getPref("granularityUserPref") |
338 |
| - +"&category="+this.getPref("categoryUserPref") |
339 |
| - +"&type="+this.getPref("barTypeUserPref") |
340 |
| - +"&theme="+this.getPref("themeUserPref") |
| 342 | + +"?filters="+encodeURIComponent(this.getPref("filterIdUserPref")) |
| 343 | + +"&labels="+encodeURIComponent(this.getPref("graphLabelUserPref")) |
| 344 | + +"&granularity="+this.getPref("granularityUserPref") |
| 345 | + +"&category="+this.getPref("categoryUserPref") |
| 346 | + +"&type="+this.getPref("barTypeUserPref") |
| 347 | + +"&theme="+this.getPref("themeUserPref") |
341 | 348 | };
|
342 | 349 | }
|
343 | 350 | }]
|
|
0 commit comments