@@ -572,6 +572,7 @@ var app = {
572
572
drawChart : function ( ) {
573
573
// clear previous content
574
574
app . ctx . clearRect ( 0 , 0 , app . w , app . h ) ;
575
+ app . ctx . oxlabels = [ ] ;
575
576
// scale...
576
577
app . wmax = 0 ;
577
578
app . scale = 1 ;
@@ -582,7 +583,6 @@ var app = {
582
583
app . scale = ( app . w - 2 * app . f ) / app . wmax ;
583
584
584
585
app . drawXOY ( ) ;
585
- app . drawScale ( ) ;
586
586
587
587
// draw all tasks
588
588
var bSplitted , aRGB ;
@@ -667,7 +667,7 @@ var app = {
667
667
} ,
668
668
669
669
drawXOY : function ( ) {
670
- var ctx = app . ctx , w = app . w , h = app . h , f = app . f ;
670
+ var ctx = app . ctx , w = app . w , h = app . h , f = app . f , scale = app . scale ;
671
671
ctx . beginPath ( ) ;
672
672
ctx . moveTo ( f , f ) ;
673
673
ctx . lineTo ( w , f ) ;
@@ -682,10 +682,8 @@ var app = {
682
682
ctx . moveTo ( f , h + f - 20 ) ;
683
683
ctx . lineTo ( f + f / 3 , h - f ) ;
684
684
ctx . stroke ( ) ;
685
- } ,
686
685
687
- drawScale : function ( ) {
688
- var ctx = app . ctx , f = app . f , scale = app . scale ;
686
+ // horizontal scale
689
687
for ( var i = 1 ; i < app . wmax ; i ++ ) {
690
688
ctx . beginPath ( ) ;
691
689
ctx . moveTo ( scale * i + f , f - 5 ) ;
@@ -955,7 +953,10 @@ Task.prototype.drawTask = function(r,g,b,bLineToDeadlineMark){
955
953
if ( ! app . bOneLine ) {
956
954
ctx . write ( 0 , ti * 20 + f + 15 + u , "T" + this . i , "rgb(0,0,0)" , 10 , true ) ;
957
955
} else {
958
- ctx . write ( 0 , ti * 20 + f + 15 + u , "M" + this . M , "rgb(0,0,0)" , 10 , true ) ;
956
+ if ( ! ctx . oxlabels [ this . M ] ) {
957
+ ctx . oxlabels [ this . M ] = true ;
958
+ ctx . write ( 0 , ti * 20 + f + 15 + u , "M" + this . M , "rgb(0,0,0)" , 10 , true ) ;
959
+ }
959
960
ctx . write ( scale * this . s + f , ti * 20 + f + 15 + u , "" + this . i , "rgb(0,0,0)" , 10 , true ) ;
960
961
}
961
962
} ;
0 commit comments