Display ticket statistics charts

Description

Make various types of charts regarding the number of tickets using Open Flash Charts. Chart types:

  • Pie charts.
  • Bar charts.
  • Stacked bar charts.

The charts are created by the parameters that you give to the macro. See the examples below.

All charts are clickable and will link to the query page of the graph.

See also TracTicketStatsPlugin, TracMetrixPlugin.

Bugs/Feature Requests

Existing bugs and feature requests for TicketChartsMacro are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out TicketChartsMacro from here using Subversion, or browse the source with Trac.

Installation

  • Download the source.
  • Copy the file TicketCharts.py to your project's plugins directory or to the global plugins directory, which is usually in:
    /usr/share/trac/plugins
    
  • Enable TicketCharts plugin via the WebAdmin interface or by adding the following lines to the [components] section of trac.ini:
    ticketcharts.* = enabled
    

Configuration

  • The following configuration can appear in trac.ini (default values are shown):
    [ticket-charts]
    height = 300
    width = 500
    

Macro arguments

Although I believe the examples show it all, I'll write here the arguments:

  • Arguments for all types of graphs:
    • type - The type of the graph. Can be pie, bars or stacked_bars.
    • height, width - The height and width of the graph, in pixels. Percents will not work. If not specified, the values from trac.ini are taken (and if those aren't specified, then other default values are used).
    • title - Text that will be displayed on the top of the chart.
    • query - A Trac Query. All the stats will be taken from this query. Examples:
      query = milestone=my_milestone&owner=aviram|danny
      
    • factor - The name of the field by which the stats will be formed.
  • Arguments for bar graphs:
    • x_axis - The name of the field by which the stats will be formed (The X Axis values).
  • Arguments for stacked bars graphs:
    • x_axis - The name of the field by which the stats will be formed (The X Axis values).
    • key - The name of the field by which the chart's columns are divided.

Examples with Snapshots

Number of tickets per milestone:

[[TicketChart(type = pie, factor = milestone)]]

Number of tickets per status for milestone4:

[[TicketChart(type = pie, factor = status, query = milestone=milestone4)]]

Number of tickets by status and owners:

[[TicketChart(type = stacked_bars, key = owner, x_axis = status, height = 400, width = 600)]]

Number of tickets by status and owner for milestone1:

[[TicketChart(type = stacked_bars, key = owner, x_axis = status, query = milestone=milestone1, title = Tickets by status and owner for milestone1)]]

Number of tickets by owner and type:

[[TicketChart(type = stacked_bars, key = type, x_axis = owner)]]

Number of tickets by status for milestone4:

[[TicketChart(type = bars, x_axis = status, query = milestone=milestone4, title = Tickets by status for milestone4)]]

Recent Changes

[13176] by rjollos on 05/20/13 07:48:49

Refs #11072: Part of [13175]. Directories don't get deleted in Git, so it seems to be necessary to remove them directly in SVN.

[13175] by rjollos on 05/20/13 07:46:26

Refs #11072: package_data was incorrect for files in js/json. Eliminated json subdirectory and moved json2.js in parent js directory.

[13164] by rjollos on 05/19/13 08:19:59

Refs #11072: Fixed traceback when key was not specified for a bar chart. The key is now optional.

[13163] by rjollos on 05/19/13 08:19:50

Refactored _create_query_object.

Author/Contributors

Author: aviram
Maintainer: none (needsadoption)
Contributors:

Attachments