Skip to content

Commit

Permalink
Always draw 0 on the y-axis.
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Jun 3, 2013
1 parent 3cdecb1 commit 4fbc065
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,11 @@ window.Chart = function(context){

ctx.textAlign = "right";
ctx.textBaseline = "middle";

// Always draw 0 on y-axis.
// Note this bypasses the templating process.
ctx.fillText('0',yAxisPosX-8,xAxisPosY);

for (var j=0; j<calculatedScale.steps; j++){
ctx.beginPath();
ctx.moveTo(yAxisPosX-3,xAxisPosY - ((j+1) * scaleHop));
Expand Down

1 comment on commit 4fbc065

@theronpatrick
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.