fix: enable sampling in fixed bandSize

This commit is contained in:
Howard Zhang 2023-09-11 12:32:39 +08:00 committed by Weixing Zhang
parent da38e68c40
commit e4ccacb82e
2 changed files with 1 additions and 5 deletions

View File

@ -37,10 +37,6 @@ export class CartesianBandAxis<T extends ICartesianBandAxisSpec = ICartesianBand
this.calcScales(DEFAULT_BAND_INNER_PADDING, DEFAULT_BAND_OUTER_PADDING);
}
protected _initData() {
this._initTickData(this._spec.sampling !== false && !this._spec.bandSize);
}
protected axisHelper() {
const getScale = (depth: number) => {
return this._scales[depth];

View File

@ -25,7 +25,7 @@ export const linearDiscreteTicks = (scale: BandScale, op: ICartesianTickDataOpt)
const range = scale.range();
// if range is so small
const rangeSize = Math.abs(range[range.length - 1] - range[0]);
const rangeSize = scale.calculateWholeRangeSize();
if (rangeSize < 2) {
if (op.labelLastVisible) {
return convertDomainToTickData([domain[domain.length - 1]]);