Show More
@@ -330,9 +330,9 b' E.onDOMReady(function(e){' | |||||
330 | } |
|
330 | } | |
331 |
|
331 | |||
332 | /** |
|
332 | /** | |
333 |
* This function will detect if selected period has some changesets |
|
333 | * This function will detect if selected period has some changesets | |
334 | if it does this data is then pushed for displaying |
|
334 | for this user if it does this data is then pushed for displaying | |
335 | Additionally it will only display users that are selected by the checkbox |
|
335 | Additionally it will only display users that are selected by the checkbox | |
336 | */ |
|
336 | */ | |
337 | function getDataAccordingToRanges(ranges) { |
|
337 | function getDataAccordingToRanges(ranges) { | |
338 |
|
338 | |||
@@ -340,31 +340,28 b' E.onDOMReady(function(e){' | |||||
340 | var keys = []; |
|
340 | var keys = []; | |
341 | for(var key in dataset){ |
|
341 | for(var key in dataset){ | |
342 | var push = false; |
|
342 | var push = false; | |
|
343 | ||||
343 | //method1 slow !! |
|
344 | //method1 slow !! | |
344 |
// |
|
345 | //* | |
345 | for(var ds in dataset[key].data){ |
|
346 | for(var ds in dataset[key].data){ | |
346 | commit_data = dataset[key].data[ds]; |
|
347 | commit_data = dataset[key].data[ds]; | |
347 | //console.log(key); |
|
|||
348 | //console.log(new Date(commit_data.time*1000)); |
|
|||
349 | //console.log(new Date(ranges.xaxis.from*1000)); |
|
|||
350 | //console.log(new Date(ranges.xaxis.to*1000)); |
|
|||
351 | if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){ |
|
348 | if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){ | |
352 | push = true; |
|
349 | push = true; | |
353 | break; |
|
350 | break; | |
354 | } |
|
351 | } | |
355 | } |
|
352 | } | |
356 |
|
|
353 | //*/ | |
|
354 | ||||
357 | /*//method2 sorted commit data !!! |
|
355 | /*//method2 sorted commit data !!! | |
|
356 | ||||
358 | var first_commit = dataset[key].data[0].time; |
|
357 | var first_commit = dataset[key].data[0].time; | |
359 | var last_commit = dataset[key].data[dataset[key].data.length-1].time; |
|
358 | var last_commit = dataset[key].data[dataset[key].data.length-1].time; | |
360 |
|
359 | |||
361 | console.log(first_commit); |
|
|||
362 | console.log(last_commit); |
|
|||
363 |
|
||||
364 | if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){ |
|
360 | if (first_commit >= ranges.xaxis.from && last_commit <= ranges.xaxis.to){ | |
365 | push = true; |
|
361 | push = true; | |
366 | } |
|
362 | } | |
367 | */ |
|
363 | //*/ | |
|
364 | ||||
368 | if(push){ |
|
365 | if(push){ | |
369 | data.push(dataset[key]); |
|
366 | data.push(dataset[key]); | |
370 | } |
|
367 | } | |
@@ -405,14 +402,14 b' E.onDOMReady(function(e){' | |||||
405 | new_data.push(getDummyData(checkbox_key)); |
|
402 | new_data.push(getDummyData(checkbox_key)); | |
406 | } |
|
403 | } | |
407 | } |
|
404 | } | |
408 |
|
|
405 | ||
409 | var new_options = YAHOO.lang.merge(plot_options, { |
|
406 | var new_options = YAHOO.lang.merge(plot_options, { | |
410 | xaxis: { |
|
407 | xaxis: { | |
411 | min: cur_ranges.xaxis.from, |
|
408 | min: cur_ranges.xaxis.from, | |
412 | max: cur_ranges.xaxis.to, |
|
409 | max: cur_ranges.xaxis.to, | |
413 | mode:"time", |
|
410 | mode:"time", | |
414 | timeformat: "%d/%m", |
|
411 | timeformat: "%d/%m", | |
415 | } |
|
412 | }, | |
416 | }); |
|
413 | }); | |
417 | if (!new_data){ |
|
414 | if (!new_data){ | |
418 | new_data = [[0,1]]; |
|
415 | new_data = [[0,1]]; | |
@@ -440,13 +437,20 b' E.onDOMReady(function(e){' | |||||
440 | data = getDataAccordingToRanges(ranges); |
|
437 | data = getDataAccordingToRanges(ranges); | |
441 | generateCheckboxes(data); |
|
438 | generateCheckboxes(data); | |
442 |
|
439 | |||
|
440 | ||||
|
441 | console.log(data); | |||
443 | var new_options = YAHOO.lang.merge(plot_options, { |
|
442 | var new_options = YAHOO.lang.merge(plot_options, { | |
444 | xaxis: { |
|
443 | xaxis: { | |
445 | min: ranges.xaxis.from, |
|
444 | min: ranges.xaxis.from, | |
446 | max: ranges.xaxis.to, |
|
445 | max: ranges.xaxis.to, | |
447 | mode:"time", |
|
446 | mode:"time", | |
448 | timeformat: "%d/%m", |
|
447 | timeformat: "%d/%m", | |
449 | } |
|
448 | }, | |
|
449 | yaxis: { | |||
|
450 | min: ranges.yaxis.from, | |||
|
451 | max: ranges.yaxis.to, | |||
|
452 | }, | |||
|
453 | ||||
450 | }); |
|
454 | }); | |
451 | // do the zooming |
|
455 | // do the zooming | |
452 | plot = YAHOO.widget.Flot(plotContainer, data, new_options); |
|
456 | plot = YAHOO.widget.Flot(plotContainer, data, new_options); |
General Comments 0
You need to be logged in to leave comments.
Login now