Changes between Version 3 and Version 4 of TracYetAnotherChartMacro
- Timestamp:
- May 13, 2018, 7:51:47 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracYetAnotherChartMacro
v3 v4 38 38 39 39 {{{ 40 [[yachart(id=first; title=Action statuses; query=SELECT status, COUNT(status) FROM ticket wheretype = 'Action' GROUP BY status)]]40 [[yachart(id=first; title=Action statuses; query=SELECT status, COUNT(status) FROM ticket WHERE type = 'Action' GROUP BY status)]] 41 41 }}} 42 42 … … 50 50 51 51 {{{#!ini 52 id = dom-name # The name of the HTML DOM carrying the chart. Mandatory. Must be unique for each macro call on a wiki page53 title = title-text # The headline shown above the chart. Default: blank.52 id = dom-name # The name of the HTML DOM carrying the chart. Mandatory. Must be unique for each macro call on a wiki page 53 title = title-text # The headline shown above the chart. Default: blank. 54 54 chart_type = bar|line|pie # Optional; default: bar 55 query = sql-query # Mandatory56 width = pixel-width # Optional; default: 600 pixels57 height = pixel-height # optional: default: 400 pixels55 query = sql-query # Mandatory 56 width = pixel-width # Optional; default: 600 pixels 57 height = pixel-height # Optional: default: 400 pixels 58 58 }}} 59 60 The query must return two columns. In `line` and `bar` charts, the first column will be used as x-axis data and the second column as y-axis data. In `pie` charts, the columns will be used as labels and values, respectively. 59 61 60 62 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": 61 63 62 64 [[Image(newplot(2).png, width=300)]] 65 66 WikiProcessor syntax is supported which may make queries easier to read (and write): 67 {{{ 68 {{{#!yachart 69 id=something; 70 title=something else; 71 query=SELECT 72 status, 73 COUNT(status) 74 FROM ticket 75 WHERE type = 'Action' 76 GROUP BY status; 77 }}} 78 }}} 63 79 64 80 == Recent Changes