Changeset 26052
- Timestamp:
- 12/07/08 20:42:24 (4 years ago)
- Location:
- platform/trac/plugins/querychart/trunk/querychart
- Files:
-
- 2 modified
-
htdocs/js/querychart.js (modified) (4 diffs)
-
macro.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/trac/plugins/querychart/trunk/querychart/htdocs/js/querychart.js
r26043 r26052 5 5 var opt_upper = $("#querychartopt_"+idstr+" .upper").text().toLowerCase(); 6 6 var opt_per = $("#querychartopt_"+idstr+" .per").text().toLowerCase(); 7 var tzoffset = (new Date()).getTimezoneOffset()*60*1000; 7 8 8 9 var datas = []; … … 15 16 a = $(this).text(); break; 16 17 case 1: 17 b = new Date($(this).text()).getTime() ; break;18 b = new Date($(this).text()).getTime()-tzoffset; break; 18 19 default: 19 20 c = $(this).text(); … … 38 39 39 40 var posit = opt_upper == "true" ? "se" : "ne"; 41 var x_minTickSize = opt_per == "week" ? [7,"day"] : [1,"day"]; 40 42 41 43 function showTooltip(x, y, contents){ … … 57 59 lines: { show: true }, 58 60 points: { show: true }, 59 xaxis: { mode: "time", timeformat: "%y/%m/%d" }, 61 xaxis: { mode: "time", timeformat: "%y/%m/%d", minTickSize: x_minTickSize }, 62 yaxis: { min: 0, tickDecimals: 0,autoscaleMargin: 0.05 }, 60 63 grid: { hoverable: true, clickable: false } 61 64 }); -
platform/trac/plugins/querychart/trunk/querychart/macro.py
r26043 r26052 112 112 113 113 def _make_data(self,req,opts): 114 arg_x_min = opts[' min']115 arg_x_max = opts[' max']114 arg_x_min = opts['start'] 115 arg_x_max = opts['end'] 116 116 per = opts['per'] 117 117 query_str = opts['query'] … … 163 163 return None#'''No data to output.''' 164 164 165 x_min = min(edgedays) 166 x_max = max(edgedays) 167 165 x_min = arg_x_min or min(edgedays) 166 x_max = arg_x_max or max(edgedays) 167 x_min = datetime(x_min.year,x_min.month,x_min.day,tzinfo=x_min.tzinfo) 168 x_max = datetime(x_max.year,x_max.month,x_max.day,tzinfo=x_max.tzinfo) 168 169 169 170 if per=='week': … … 179 180 for daylist,dayids in daylists: 180 181 for x in x_axis: 182 181 183 count = len([1 for c in daylist if c <= x]) 182 184 #ids = [dayids[c] for c in daylist if c <= x and c>last_x ] … … 187 189 linenum += 1 188 190 189 x_min = arg_x_min or x_min190 x_max = arg_x_max or x_max191 191 192 192 return {'x_axis':x_axis, … … 213 213 'width':'536', 214 214 'height':'300', 215 ' max':None,216 ' min':None,215 'end':None, 216 'start':None, 217 217 'query':'', 218 218 'col':[], … … 245 245 break 246 246 247 elif key in [' max','min']:247 elif key in ['start','end']: 248 248 opts[key]= parse_date(value) 249 249 else:
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)