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:
commit
97a819a44d
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue