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

Fix #89 - fix gridline rendering when using non-numeric static labels #92

Merged
merged 1 commit into from
Feb 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,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