Changes between Version 7 and Version 8 of VisualizationPlugin


Ignore:
Timestamp:
Jan 2, 2012 5:22:53 PM (3 years ago)
Author:
robguttman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VisualizationPlugin

    v7 v8  
    5454You can check out VisualizationPlugin from [http://trac-hacks.org/svn/visualizationplugin here] using Subversion, or [source:visualizationplugin browse the source] with Trac. 
    5555 
    56 == Example == 
     56== Examples == 
     57 
     58=== Existing report === 
     59The most basic usage is adding a chart to an existing report - this can be achieved with almost no configuration.  Simply list the reports in the {{{[viz]}}} section: 
     60{{{ 
     61[viz] 
     62reports = 21,23 
     63}}} 
     64 
     65The plugin will automatically determine the data types for each column.  However, the table needs to be structured suitably for graphing.  In the screenshot at the top of this page, the table was built by grouping tickets into weeks as follows (sqlite SQL): 
     66{{{ 
     67SELECT date(tc.time/1000000, 'unixepoch', 'weekday 5') as "Week ending", 
     68  SUM(CASE e.value 
     69          WHEN '' THEN 0 
     70          ELSE e.value END) AS effort 
     71  FROM ticket t 
     72    JOIN ticket_change tc ON tc.ticket = t.id and tc.field = 'status' and tc.newvalue='closed' 
     73   and tc.time=(SELECT max(time) from ticket_change tc2 where tc2.ticket = t.id and tc2.field = 'status' and tc2.newvalue='closed') 
     74  LEFT OUTER JOIN ticket_custom e ON e.ticket = t.id and e.name = 'effort' 
     75  WHERE resolution = 'fixed' AND t.type != 'epic' 
     76  GROUP BY date(tc.time/1000000, 'unixepoch', 'weekday 5') 
     77  ORDER BY date(tc.time/1000000, 'unixepoch', 'weekday 5') 
     78}}} 
     79 
     80If you prefer a column chart instead of the default area chart, you can change the chart type as follows: 
     81{{{ 
     82[viz] 
     83reports = 21,23 
     84type = ColumnChart 
     85}}} 
     86 
     87The type name must exactly match those supported by the Google Visualization API [http://code.google.com/apis/chart/interactive/docs/gallery.html here] (no spaces). You can also customize all of its options available for that chart type.  For example, the {{{ColumnChart}}} type's options can be found [http://code.google.com/apis/chart/interactive/docs/gallery/columnchart.html#Configuration_Options here].  So if we wanted to add a title and change the color for the same table as shown in the screen at the top of this page, we can so this: 
     88[viz] 
     89reports = 21,23 
     90type = ColumnChart 
     91options = colors:['green'],title='Whistle while we work' 
     92}}} 
     93 
     94[[Image(whistle.png)]] 
     95 
     96=== Burndown chart on Milestone page === 
     97 
     98 
    5799 
    58100 * table