Changes between Version 3 and Version 4 of TracYetAnotherChartMacro


Ignore:
Timestamp:
May 13, 2018, 7:51:47 PM (6 years ago)
Author:
Theodor Norup
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracYetAnotherChartMacro

    v3 v4  
    3838
    3939{{{
    40 [[yachart(id=first; title=Action statuses; query=SELECT status, COUNT(status) FROM ticket where type = 'Action' GROUP BY status)]]
     40[[yachart(id=first; title=Action statuses; query=SELECT status, COUNT(status) FROM ticket WHERE type = 'Action' GROUP BY status)]]
    4141}}}
    4242
     
    5050
    5151{{{#!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 page
    53 title      = title-text # The headline shown above the chart. Default: blank.
     52id         = dom-name     # The name of the HTML DOM carrying the chart. Mandatory. Must be unique for each macro call on a wiki page
     53title      = title-text   # The headline shown above the chart. Default: blank.
    5454chart_type = bar|line|pie # Optional; default: bar
    55 query      = sql-query # Mandatory
    56 width      = pixel-width # Optional; default: 600 pixels
    57 height     = pixel-height # optional: default: 400 pixels
     55query      = sql-query    # Mandatory
     56width      = pixel-width  # Optional; default: 600 pixels
     57height     = pixel-height # Optional: default: 400 pixels
    5858}}}
     59
     60The 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.
    5961
    6062In 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":
    6163
    6264[[Image(newplot(2).png, width=300)]]
     65
     66WikiProcessor 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}}}
    6379
    6480== Recent Changes