Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
Fix #89 - fix gridline rendering when using non-numeric static labels (
Browse files Browse the repository at this point in the history
  • Loading branch information
marzolfb authored Feb 22, 2017
1 parent d3c95b2 commit 6bbf03d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ class AxisStruct {
item: currentAxis,
path: Pathjs().moveto(start).lineto(end).closepath(),
ticks: ticks,
lines: ticks.map(c => {
const lineStart = {x: horizontal ? this.scale(c) + margin.left : xAxis.min + margin.left, y: horizontal ? yAxis.min + margin.top : this.scale(c) + margin.top}
lines: ticks.map((c,i) => {
let scaleBase = isNaN(c) ? i : c
const lineStart = {x: horizontal ? this.scale(scaleBase) + margin.left : xAxis.min + margin.left, y: horizontal ? yAxis.min + margin.top : this.scale(scaleBase) + margin.top}
return Pathjs().moveto(lineStart).lineto(horizontal ? lineStart.x : xAxis.max + margin.left, horizontal ? yAxis.max + (margin.top - tailLength) : lineStart.y)
},this)
}
Expand Down

0 comments on commit 6bbf03d

Please sign in to comment.