Changes between Version 31 and Version 32 of VisualizationPlugin
- Timestamp:
- May 18, 2013, 5:51:32 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VisualizationPlugin
v31 v32 16 16 1. Install the plugin (after downloading and unzipping): 17 17 {{{ 18 #!sh 18 19 cd visualizationplugin/0.12 19 20 sudo python setup.py bdist_egg … … 25 26 2. Enable the plugin: 26 27 {{{ 28 #!ini 27 29 [components] 28 30 viz.* = enabled … … 33 35 3. Configure which pages to include graphs - example: 34 36 {{{ 37 #!ini 35 38 [viz] 36 39 reports = 21 … … 63 66 The 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}}}: 64 67 {{{ 68 #!ini 65 69 [viz] 66 70 reports = 21,23 … … 69 73 The 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): 70 74 {{{ 75 #!sql 71 76 SELECT date(tc.time/1000000, 'unixepoch', 'weekday 5') as "Week ending", 72 77 SUM(CASE e.value … … 88 93 If you prefer a column chart instead of the default area chart, you can change the chart type as follows: 89 94 {{{ 95 #!ini 90 96 [viz] 91 97 reports = 21,23 … … 95 101 The 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: 96 102 {{{ 103 #!ini 97 104 [viz] 98 105 reports = 21,23 … … 106 113 If 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: 107 114 {{{ 115 #!ini 108 116 [viz] 109 117 options = width:600,height:400 … … 125 133 In 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: 126 134 {{{ 135 #!ini 127 136 [viz.milestone] 128 137 # Burndown … … 151 160 To 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). 152 161 153 154 162 == Recent Changes == 155 163