Merge pull request woocommerce/woocommerce-admin#635 from woocommerce/add/chart-uneven-ticks

Chart: remove last x-axis tick in an uneven series
This commit is contained in:
Robert Elliott 2018-10-25 11:10:31 +02:00 committed by GitHub
commit 97a819a44d
1 changed files with 1 additions and 4 deletions

View File

@ -264,13 +264,10 @@ const getXTicksFromIncrementFactor = ( uniqueDates, incrementFactor ) => {
ticks.push( uniqueDates[ idx ] );
}
// If the first or last date is missing from the ticks array, add it back in.
// If the first date is missing from the ticks array, add it back in.
if ( ticks[ 0 ] !== uniqueDates[ 0 ] ) {
ticks.unshift( uniqueDates[ 0 ] );
}
if ( ticks[ ticks.length - 1 ] !== uniqueDates[ uniqueDates.length - 1 ] ) {
ticks.push( uniqueDates[ uniqueDates.length - 1 ] );
}
return ticks;
};