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

Added options for axis tick size and color #159

Merged
merged 1 commit into from
May 26, 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
10 changes: 9 additions & 1 deletion src/Axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ export default class Axis extends Component {
options.strokeWidth = 3
}

if (typeof options.tickSize !== 'number') {
options.tickSize = 2
}

if (typeof options.tickColor !== 'string') {
options.tickColor = 'grey'
}

const textStyle = fontAdapt(options.label)

const ticks =_.map(axis.ticks, function (c, i) {
Expand All @@ -153,7 +161,7 @@ export default class Axis extends Component {
returnValue =
<G key={i} x={gxy[0]} y={gxy[1]}>
{options.showTicks &&
<Circle r="2" cx="0" cy="0" stroke="grey" fill="grey" />
<Circle r={options.tickSize} cx="0" cy="0" stroke={options.tickColor} fill={options.tickColor} />
}
{options.showLabels &&
<Text x={xy[0]} y={xy[1]}
Expand Down