Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #313 from FormidableLabs/bug/update-tickValues
Browse files Browse the repository at this point in the history
use tickFormat strings when no tickValues exist
  • Loading branch information
boygirl authored Oct 19, 2017
2 parents 1647965 + 98f0294 commit 2989e84
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/victory-util/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,13 @@ export default {
* @returns {Array} an array of strings
*/
getStringsFromAxes(props, axis) {
if (!props.tickValues || (!Array.isArray(props.tickValues) && !props.tickValues[axis])) {
return [];
const { tickValues, tickFormat } = props;
let tickValueArray;
if (!tickValues || (!Array.isArray(tickValues) && !tickValues[axis])) {
tickValueArray = tickFormat && Array.isArray(tickFormat) ? tickFormat : [];
} else {
tickValueArray = tickValues[axis] || tickValues;
}
const tickValueArray = props.tickValues[axis] || props.tickValues;
return tickValueArray.filter((val) => typeof val === "string");
},

Expand Down

0 comments on commit 2989e84

Please sign in to comment.