Changeset 1651 for trunk/LATMOS-Accounts-Web/root/static/js
- Timestamp:
- 01/22/16 06:25:19 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/root/static/js/timeline/timeframe.js
r1611 r1651 32 32 33 33 this.outerWidth = this.container.innerWidth(); 34 this.outerHeight = 1 00;34 this.outerHeight = 140; 35 35 this.paddingX = 40; 36 this.paddingY = 20;36 this.paddingY = 60; 37 37 38 38 this.width = this.outerWidth - (this.paddingX * 2); … … 112 112 Timeline.prototype.addEvent = function (eventData, category) { 113 113 var event = { 114 name: eventData.name, 115 date: parseDateString(eventData.date) 114 name: eventData.name, 115 date: parseDateString(eventData.date), 116 options: eventData.options ? eventData.options : {}, 116 117 }; 117 118 category.events.push(event); … … 227 228 .appendTo(group); 228 229 230 var color = 231 event.options.type == 'alarm' ? 'red' 232 : event.options.type == 'employment' ? 'green' 233 : 'blue'; 234 var labelHeigth = event.options.type == 'alarm' 235 ? 32 236 : 12; 229 237 var line = $svg.line( 230 238 x, 231 239 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY, 232 240 x, 233 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY - 24241 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY - labelHeigth 234 242 ) 235 .attr("stroke", "blue")243 .attr("stroke", color) 236 244 .attr("stroke-width", 1) 237 245 .appendTo(group); … … 239 247 var label = $svg.text( 240 248 x, 241 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY - 32,249 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY - (labelHeigth + 8), 242 250 event.name, 243 251 { 244 fill: "blue",252 fill: color, 245 253 "font-size": "12", 246 254 "text-anchor": "middle" … … 248 256 ) 249 257 .appendTo(group); 258 259 if (event.options.showdate) { 260 var line = $svg.line( 261 x, 262 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY, 263 x, 264 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY + 16 265 ) 266 .attr("stroke", color) 267 .attr("stroke-width", 1) 268 .appendTo(group); 269 270 var label = $svg.text( 271 x, 272 this.height - this.options.textHeight - this.options.tickHeight + this.paddingY + 24, 273 $.datepicker.formatDate('dd/mm/yy', event.date), 274 { 275 fill: color, 276 "font-size": "11", 277 "text-anchor": "middle" 278 } 279 ) 280 .appendTo(group); 281 } 250 282 }; 251 283 … … 275 307 var label = $svg.text( 276 308 (startX + endX) / 2, 277 this.height + this.options.textHeight - this.options.tickHeight + this.paddingY + 8,309 this.height + this.options.textHeight - this.options.tickHeight + this.paddingY + 24, 278 310 span.name, 279 311 {
Note: See TracChangeset
for help on using the changeset viewer.