Skip to content

Commit

Permalink
fix: fix failed test cases and improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed May 10, 2024
1 parent 952fa45 commit 0c90824
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/coord/axisTickLabelBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,7 @@ type InnerStore = {
const inner = makeInner<InnerStore, any>();

function tickValuesToNumbers(axis: Axis, values: (number | string | Date)[]) {
const nums = values.map(val => {
if (zrUtil.isString(val)) {
return axis.model.get('data').indexOf(val);
}
else if (val instanceof Date) {
return val.getTime();
}
else {
return val;
}
});
const nums = zrUtil.map(values, val => axis.scale.parse(val));
if (axis.type === 'time' && nums.length > 0) {
// Time axis needs duplicate first/last tick (see TimeScale.getTicks())
// The first and last tick/label don't get drawn
Expand Down
2 changes: 1 addition & 1 deletion test/axis-customTicks.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0c90824

Please sign in to comment.