| 37 | == Usage |
| 38 | |
| 39 | {{{ |
| 40 | [[yachart(id=first; title=Action statuses; query=SELECT status, COUNT(status) FROM ticket where type = 'Action' GROUP BY status)]] |
| 41 | }}} |
| 42 | ...will result in something like this: |
| 43 | [[Image(newplot(1).png, width=300)]] |
| 44 | |
| 45 | === Parameters |
| 46 | |
| 47 | Note the unusual use of semicolon as delimiter character - this is chosen in order to avoid escaping commas in the SQL query |
| 48 | |
| 49 | {{{#!ini |
| 50 | id = dom-name # The name of the HTML DOM carrying the chart. Mandatory. Must be unique for each macro call on a wiki page |
| 51 | title = title-text # The headline shown above the chart. Default: blank. |
| 52 | chart_type = bar|line|pie # Optional; default: bar |
| 53 | query = sql-query # Mandatory |
| 54 | width = pixel-width # Optional; default: 600 pixels |
| 55 | height = pixel-height # optional: default: 400 pixels |
| 56 | }}} |
| 57 | |
| 58 | In the query, the macro will replace the string `$USER` with the id of the user logged in. This can be used to display "my tickets": |
| 59 | |
| 60 | |
| 61 | |