B2G/gaia/apps/costcontrol/js/views/datausage.js
// Check if the segment of the graph is inside chart area. If so, draw it
Check if the segment of the graph is inside chart area. If so, draw it
Check if the segment of the graph is inside chart area . If so draw it
function clipAndDrawSegment(ctx, model, x0, y0, x1, y1) {
    if (x0 >= model.originX && x1 <= model.endX) {
      var x0Fixed = Math.floor(x0) - 0.5;
      var x1Fixed = Math.floor(x1) + 0.5;
      ctx.globalCompositeOperation = 'destination-over';
      ctx.beginPath();
      ctx.lineTo(x1Fixed, y1);
      ctx.lineTo(x1Fixed, model.originY);
      ctx.lineTo(x0Fixed, model.originY);
      ctx.lineTo(x0Fixed, y0);
      ctx.moveTo(x1Fixed, y0);
      ctx.fill();
      ctx.globalCompositeOperation = 'source-over';
      ctx.beginPath();
      ctx.moveTo(x0Fixed, y0);
      ctx.lineTo(x1Fixed, y1);
      ctx.stroke();
    }
  }
function clipAndDrawSegment ( ctx , model , x0 , y0 , x1 , y1 ) { if ( x0 >= model . originX && x1 <= model . endX ) { var x0Fixed = Math . floor ( x0 ) - 0.5 ; var x1Fixed = Math . floor ( x1 ) + 0.5 ; ctx . globalCompositeOperation = 'destination-over' ; ctx . beginPath ( ) ; ctx . lineTo ( x1Fixed , y1 ) ; ctx . lineTo ( x1Fixed , model . originY ) ; ctx . lineTo ( x0Fixed , model . originY ) ; ctx . lineTo ( x0Fixed , y0 ) ; ctx . moveTo ( x1Fixed , y0 ) ; ctx . fill ( ) ; ctx . globalCompositeOperation = 'source-over' ; ctx . beginPath ( ) ; ctx . moveTo ( x0Fixed , y0 ) ; ctx . lineTo ( x1Fixed , y1 ) ; ctx . stroke ( ) ; } }
Check if the segment of the graph is inside chart area.
Check if the segment of the graph is inside chart area .
// Fill // Stroke