Changes between Version 31 and Version 32 of VisualizationPlugin


Ignore:
Timestamp:
May 18, 2013 7:51:32 AM (11 months ago)
Author:
rjollos
Comment:

Added syntax highlighting.

Legend:

Unmodified
Added
Removed
Modified
  • VisualizationPlugin

    v31 v32  
    1616 1. Install the plugin (after downloading and unzipping): 
    1717    {{{ 
     18    #!sh 
    1819    cd visualizationplugin/0.12 
    1920    sudo python setup.py bdist_egg 
     
    2526 2. Enable the plugin: 
    2627    {{{ 
     28    #!ini 
    2729    [components] 
    2830    viz.* = enabled 
     
    3335 3. Configure which pages to include graphs - example: 
    3436    {{{ 
     37    #!ini 
    3538    [viz] 
    3639    reports = 21 
     
    6366The 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 in {{{trac.ini}}}: 
    6467{{{ 
     68#!ini 
    6569[viz] 
    6670reports = 21,23 
     
    6973The 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): 
    7074{{{ 
     75#!sql 
    7176SELECT date(tc.time/1000000, 'unixepoch', 'weekday 5') as "Week ending", 
    7277  SUM(CASE e.value 
     
    8893If you prefer a column chart instead of the default area chart, you can change the chart type as follows: 
    8994{{{ 
     95#!ini 
    9096[viz] 
    9197reports = 21,23 
     
    95101The 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 do this: 
    96102{{{ 
     103#!ini 
    97104[viz] 
    98105reports = 21,23 
     
    106113If you use multiple graphs and charts, you may want to customize them differently for different reports.  To do that, create a new section for the reports instead of including them in the main {{{[viz]}}} section's {{{reports}}} option: 
    107114{{{ 
     115#!ini 
    108116[viz] 
    109117options = width:600,height:400 
     
    125133In the examples above, the data for the charts came from a report table located on the same page.  You can also create charts by [http://code.google.com/apis/chart/interactive/docs/queries.html querying remote data sources] that conform to the [http://code.google.com/apis/chart/interactive/docs/dev/implementing_data_source.html Google Visualization Data Source API].  One such example is the [wiki:SumStatsPlugin SumStats plugin] which provides a data source amenable to graphing as a daily burndown chart on any milestone page.  For example: 
    126134{{{ 
     135#!ini 
    127136[viz.milestone] 
    128137# Burndown 
     
    151160To embed iGoogle Gadgets in wiki pages using WikiFormatting, you may wish to try [http://pypi.python.org/pypi/TracGViz TracGViz plugin] (I have not yet tried this myself). 
    152161 
    153  
    154162== Recent Changes == 
    155163