id	summary	reporter	owner	description	type	status	priority	component	severity	resolution	keywords	cc	release
10579	[PATCH] colorBy=status should use fixed colours	falkb	ChrisNelson	This little patch sets fixed colours if you choose {{{ colorBy=status }}} as chart option. It's a user request here because they were confused and didn't realize why the colours changed from time to time, and they wished they can accociate a certain state with certain fixed colours. (Remember, currently {{{ _buildMap(colorBy) }}} traverses the tickets and simply increments the colour in the map by the states it finds first on its way through the tickets). Note, I use a hard-coded state<->colour mapping as desired here:\r\n\r\n{{{\r\n#!diff\r\nIndex: tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py\r\n===================================================================\r\n--- tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py_(revision 12265)\r\n+++ tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py_(working copy)\r\n@@ -409,6 +410,16 @@\r\n                     i = i + 1\r\n                     self.classMap[t[field]] = i\r\n \r\n+        def _buildStatusMap(field):\r\n+            self.classMap = {}\r\n+            self.classMap['new'] = 1\r\n+            self.classMap['reopened'] = 1\r\n+            self.classMap['assigned'] = 2\r\n+            self.classMap['needs_work'] = 2\r\n+            self.classMap['accepted'] = 4\r\n+            self.classMap['testing'] = 0\r\n+            self.classMap['closed'] = 3\r\n+\r\n         def _buildEnumMap(field):\r\n             self.classMap = {}\r\n             db = self.env.get_db_cnx()\r\n@@ -427,6 +438,8 @@\r\n             # Enums (TODO: what others should I list?)\r\n             if options['colorBy'] in ['priority', 'severity']:\r\n                 _buildEnumMap(colorBy)\r\n+            elif options['colorBy'] in ['status']:\r\n+                _buildStatusMap(colorBy)\r\n             else:\r\n                 _buildMap(colorBy)\r\n \r\n}}}	enhancement	new	normal	TracJsGanttPlugin	normal				
