Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rtl legend text alignment (#9199)
* Start fixing RTL * Broken test * Fix right alignment for horizontal legends
- Loading branch information
Showing
12 changed files
with
130 additions
and
4 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
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/plugin.legend/label-textAlign/horizontal-left.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: 'pie', | ||
data: { | ||
labels: ['aaaa', 'bb', 'c'], | ||
datasets: [ | ||
{ | ||
data: [1, 2, 3] | ||
} | ||
] | ||
}, | ||
options: { | ||
plugins: { | ||
legend: { | ||
position: 'top', | ||
labels: { | ||
textAlign: 'left' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
width: 256, | ||
height: 256 | ||
} | ||
} | ||
}; |
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/plugin.legend/label-textAlign/horizontal-right.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: 'pie', | ||
data: { | ||
labels: ['aaaa', 'bb', 'c'], | ||
datasets: [ | ||
{ | ||
data: [1, 2, 3] | ||
} | ||
] | ||
}, | ||
options: { | ||
plugins: { | ||
legend: { | ||
position: 'top', | ||
labels: { | ||
textAlign: 'right' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
width: 256, | ||
height: 256 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
test/fixtures/plugin.legend/label-textAlign/horizontal-rtl-left.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,31 @@ | ||
module.exports = { | ||
config: { | ||
type: 'pie', | ||
data: { | ||
labels: ['aaaa', 'bb', 'c'], | ||
datasets: [ | ||
{ | ||
data: [1, 2, 3] | ||
} | ||
] | ||
}, | ||
options: { | ||
plugins: { | ||
legend: { | ||
position: 'top', | ||
rtl: true, | ||
labels: { | ||
textAlign: 'left' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
width: 256, | ||
height: 256 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions
31
test/fixtures/plugin.legend/label-textAlign/horizontal-rtl-right.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,31 @@ | ||
module.exports = { | ||
config: { | ||
type: 'pie', | ||
data: { | ||
labels: ['aaaa', 'bb', 'c'], | ||
datasets: [ | ||
{ | ||
data: [1, 2, 3] | ||
} | ||
] | ||
}, | ||
options: { | ||
plugins: { | ||
legend: { | ||
rtl: true, | ||
position: 'top', | ||
labels: { | ||
textAlign: 'right' | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
spriteText: true, | ||
canvas: { | ||
width: 256, | ||
height: 256 | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.