Skip to content

Commit

Permalink
Update Y-title offset from labels; Hide the last Y-tick/label/grid
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaono authored and sanjaypojo committed Feb 12, 2018
1 parent d2cad99 commit a852a5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Axis.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ class YAxis extends React.Component {
}

if (this.props.yTitle) {
let rotation = "rotate(-90,30,"+String(this.props.y+this.props.height/2)+")"
let rotation = "rotate(-90,15,"+String(this.props.y+this.props.height/2)+")"
yAxis.push(
<text key="yTitle" x={30} y={this.props.y+this.props.height/2}
<text key="yTitle" x={15} y={this.props.y+this.props.height/2}
textAnchor="middle" transform={rotation}
fontSize={18} fill={this.props.style.titleColor}>
{this.props.yTitle}
Expand All @@ -116,7 +116,7 @@ class YAxis extends React.Component {

let ySpace = this.props.height / (this.props.ySteps - 1)

for (var i=0; i < this.props.ySteps; i++) {
for (var i=0; i < this.props.ySteps - 1; i++) {
let tickPos = this.props.height+this.props.y-i*ySpace

let yVal = 0
Expand Down

0 comments on commit a852a5b

Please sign in to comment.