Changes between Version 34 and Version 35 of VisualizationPlugin
- Timestamp:
- Nov 10, 2015, 9:08:16 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
VisualizationPlugin
v34 v35 19 19 20 20 If you have any issues, create a 21 [ http://trac-hacks.org/newticket?component=VisualizationPlugin&owner=robguttman new ticket].21 [/newticket?component=VisualizationPlugin new ticket]. 22 22 23 23 [[TicketQuery(component=VisualizationPlugin&group=type,format=progress)]] … … 25 25 == Download 26 26 27 Download the zipped source from [ download:visualizationplugin here].27 Download the zipped source from [export:visualizationplugin here]. 28 28 29 29 == Source 30 30 31 You can check out VisualizationPlugin from [ http://trac-hacks.org/svn/visualizationplugin here] using Subversion, or [source:visualizationplugin browse the source] with Trac.31 You can check out VisualizationPlugin from [/svn/visualizationplugin here] using Subversion, or [source:visualizationplugin browse the source] with Trac. 32 32 33 33 == Installation and Configuration 34 34 35 35 1. Install the plugin after downloading and unzipping: 36 {{{ 37 #!sh 36 {{{#!sh 38 37 cd visualizationplugin/0.12 39 38 sudo python setup.py bdist_egg … … 44 43 45 44 2. Enable the plugin in `trac.ini`: 46 {{{ 47 #!ini 45 {{{#!ini 48 46 [components] 49 47 viz.* = enabled … … 53 51 54 52 3. Configure which pages to include graphs in `trac.ini`: 55 {{{ 56 #!ini 53 {{{#!ini 57 54 [viz] 58 55 reports = 21 … … 68 65 69 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}}}: 70 {{{ 71 #!ini 67 {{{#!ini 72 68 [viz] 73 69 reports = 21,23 … … 75 71 76 72 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): 77 {{{ 78 #!sql 73 {{{#!sql 79 74 SELECT date(tc.time/1000000, 'unixepoch', 'weekday 5') as "Week ending", 80 75 SUM(CASE e.value … … 95 90 96 91 If you prefer a column chart instead of the default area chart, you can change the chart type as follows: 97 {{{ 98 #!ini 92 {{{#!ini 99 93 [viz] 100 94 reports = 21,23 … … 103 97 104 98 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: 105 {{{ 106 #!ini 99 {{{#!ini 107 100 [viz] 108 101 reports = 21,23 … … 116 109 117 110 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 in `trac.ini`: 118 {{{ 119 #!ini 111 {{{#!ini 120 112 [viz] 121 113 options = width:600,height:400 … … 132 124 You customize a page's graph by creating a section that matches all or part of its url after a {{{viz.}}} prefix. So for example, the above customizes reports 21 and 23 differently. Report 21 will be a green column chart with the given title, and report 23 will be a red area chart with its given title. Both charts will inherit the {{{[viz]}}} section's width and height, however. 133 125 134 '''Important''': whereas the {{{options}}} option ''adds'' to the base {{{[viz]}}} section's {{{options}}}, all other options, such as {{{type}}}, ''override'' the base {{{[viz]}}} section's options.126 '''Note''': whereas the {{{options}}} option ''adds'' to the base {{{[viz]}}} section's {{{options}}}, all other options, such as {{{type}}}, ''override'' the base {{{[viz]}}} section's options. 135 127 136 128 === Burndown chart on milestone pages 137 129 138 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: 139 {{{ 140 #!ini 130 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. 131 132 For example: 133 {{{#!ini 141 134 [viz.milestone] 142 135 # Burndown