Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] support crossAlign on mirrored y-axis (#9563)
- Loading branch information
1 parent
4d99658
commit f8a9d60
Showing
13 changed files
with
200 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/fixtures/core.scale/crossAlignment/mirror-cross-align-left-center.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Long long label 1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
y: { | ||
position: 'left', | ||
ticks: { | ||
mirror: true, | ||
crossAlign: 'center', | ||
}, | ||
}, | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+10.4 KB
test/fixtures/core.scale/crossAlignment/mirror-cross-align-left-center.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
test/fixtures/core.scale/crossAlignment/mirror-cross-align-left-far.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Long long label 1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
y: { | ||
position: 'left', | ||
ticks: { | ||
mirror: true, | ||
crossAlign: 'far', | ||
}, | ||
}, | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+10.5 KB
test/fixtures/core.scale/crossAlignment/mirror-cross-align-left-far.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
test/fixtures/core.scale/crossAlignment/mirror-cross-align-left-near.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Long long label 1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
y: { | ||
position: 'left', | ||
ticks: { | ||
mirror: true, | ||
crossAlign: 'near', | ||
}, | ||
}, | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+10.5 KB
test/fixtures/core.scale/crossAlignment/mirror-cross-align-left-near.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
test/fixtures/core.scale/crossAlignment/mirror-cross-align-right-center.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Long long label 1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
y: { | ||
position: 'right', | ||
ticks: { | ||
mirror: true, | ||
crossAlign: 'center', | ||
}, | ||
}, | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+11 KB
test/fixtures/core.scale/crossAlignment/mirror-cross-align-right-center.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
test/fixtures/core.scale/crossAlignment/mirror-cross-align-right-far.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Long long label 1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
y: { | ||
position: 'right', | ||
ticks: { | ||
mirror: true, | ||
crossAlign: 'far', | ||
}, | ||
}, | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+11.1 KB
test/fixtures/core.scale/crossAlignment/mirror-cross-align-right-far.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions
30
test/fixtures/core.scale/crossAlignment/mirror-cross-align-right-near.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
datasets: [{ | ||
data: [1, 2, 3], | ||
}], | ||
labels: ['Long long label 1', 'Label2', 'Label3'] | ||
}, | ||
options: { | ||
indexAxis: 'y', | ||
scales: { | ||
y: { | ||
position: 'right', | ||
ticks: { | ||
mirror: true, | ||
crossAlign: 'near', | ||
}, | ||
}, | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Binary file added
BIN
+11 KB
test/fixtures/core.scale/crossAlignment/mirror-cross-align-right-near.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.