Class/Graph.js
// DRAW GRID: draw major, minor lines and display values
DRAW GRID: draw major, minor lines and display values
DRAW GRID : draw major minor lines and display values
drawgrid (xmajor,xminor,ymajor,yminor){
		let x_tick_major=xmajor/this.x_displ_scal;
		let x_tick_minor=xminor/this.x_displ_scal;
		let y_tick_major=ymajor/this.y_displ_scal;
		let y_tick_minor=yminor/this.y_displ_scal;
		this.ctx.strokeStyle = '#999999';
		this.ctx.lineWidth = 1;		
		this.ctx.beginPath() ;			
		this.yy = this.y_max;
		do {
			this.ctx.moveTo(this.x_min,this.yy);
			this.ctx.lineTo(this.x_max,this.yy);
			this.yy += y_tick_major;
		} while (this.yy <= this.y_min);
		this.xx = this.x_min;
		do {
			this.ctx.moveTo(this.xx,this.y_min);
			this.ctx.lineTo(this.xx,this.y_max);
			this.xx+= x_tick_major;
		} while (this.xx <= this.x_max);
		this.ctx.stroke();						
		this.ctx.strokeStyle = '#cccccc';
		this.ctx.lineWidth = 1;	
		this.ctx.beginPath() ;			
		this.yy = this.y_max;
		do {
			this.ctx.moveTo(this.x_min,this.yy);
			this.ctx.lineTo(this.x_max,this.yy);
			this.yy+= y_tick_minor;
		} while (this.yy <= this.y_min);
		this.xx=this.x_min;
		do {
			this.ctx.moveTo(this.xx,this.y_min);
			this.ctx.lineTo(this.xx,this.y_max);
			this.xx+= x_tick_minor;
		} while (this.xx <= this.x_max);
		this.ctx.stroke();	
		this.ctx.font = "10pt Arial";
		this.ctx.fillStyle = '#000000';
		this.ctx.textAlign = "right";
		this.ctx.textBaseline = "top";		
		this.yy=this.y_max;	
		do {
			let y_displ=(this.y_orig - this.yy) * this.y_displ_scal;
			this.ctx.fillText(y_displ,this.txpos + 5,this.yy - this.th / 2);
			this.yy+= y_tick_major;
		} while (this.yy <= this.y_min);	
		this.ctx.textAlign = "left";
		this.ctx.textBaseline = "top";				
		this.xx=this.x_min;
		do {
			let x_displ=(this.xx - this.x_orig) * this.x_displ_scal;
			this.ctx.fillText(x_displ,this.xx - this.tw + 10,this.typos + 5);			
			this.xx+= x_tick_major;
		} while (this.xx <= this.x_max);				
	}
drawgrid ( xmajor , xminor , ymajor , yminor ) { let x_tick_major = xmajor / this . x_displ_scal ; let x_tick_minor = xminor / this . x_displ_scal ; let y_tick_major = ymajor / this . y_displ_scal ; let y_tick_minor = yminor / this . y_displ_scal ; this . ctx . strokeStyle = '#999999' ; this . ctx . lineWidth = 1 ; this . ctx . beginPath ( ) ; this . yy = this . y_max ; do { this . ctx . moveTo ( this . x_min , this . yy ) ; this . ctx . lineTo ( this . x_max , this . yy ) ; this . yy += y_tick_major ; } while ( this . yy <= this . y_min ) ; this . xx = this . x_min ; do { this . ctx . moveTo ( this . xx , this . y_min ) ; this . ctx . lineTo ( this . xx , this . y_max ) ; this . xx += x_tick_major ; } while ( this . xx <= this . x_max ) ; this . ctx . stroke ( ) ; this . ctx . strokeStyle = '#cccccc' ; this . ctx . lineWidth = 1 ; this . ctx . beginPath ( ) ; this . yy = this . y_max ; do { this . ctx . moveTo ( this . x_min , this . yy ) ; this . ctx . lineTo ( this . x_max , this . yy ) ; this . yy += y_tick_minor ; } while ( this . yy <= this . y_min ) ; this . xx = this . x_min ; do { this . ctx . moveTo ( this . xx , this . y_min ) ; this . ctx . lineTo ( this . xx , this . y_max ) ; this . xx += x_tick_minor ; } while ( this . xx <= this . x_max ) ; this . ctx . stroke ( ) ; this . ctx . font = "10pt Arial" ; this . ctx . fillStyle = '#000000' ; this . ctx . textAlign = "right" ; this . ctx . textBaseline = "top" ; this . yy = this . y_max ; do { let y_displ = ( this . y_orig - this . yy ) * this . y_displ_scal ; this . ctx . fillText ( y_displ , this . txpos + 5 , this . yy - this . th / 2 ) ; this . yy += y_tick_major ; } while ( this . yy <= this . y_min ) ; this . ctx . textAlign = "left" ; this . ctx . textBaseline = "top" ; this . xx = this . x_min ; do { let x_displ = ( this . xx - this . x_orig ) * this . x_displ_scal ; this . ctx . fillText ( x_displ , this . xx - this . tw + 10 , this . typos + 5 ) ; this . xx += x_tick_major ; } while ( this . xx <= this . x_max ) ; }
DRAW GRID: draw major, minor lines and display values
DRAW GRID : draw major minor lines and display values
// draw major grid lines // draw minor grid lines			 //display values