-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* FIX: render multiline legend items without overlapping (#10532) Co-authored-by: Nirav Chavda <[email protected]> * CLN: Extract method to fix codeclimate line count Co-authored-by: Nirav Chavda <[email protected]> * CLN: Shift helper methods from class to module scope Co-authored-by: Nirav Chavda <[email protected]> * TST: Add test with fixtures Co-authored-by: kartik <[email protected]> * FIX: Fix test case for multiline label Co-authored-by: kartik <[email protected]> * 10532-ENH: Calculate legend item width for multiline labels Co-authored-by: Nirav Chavda <[email protected]> * 10532-TST: use spriteText and non-empty labels for test Co-authored-by: Nirav Chavda <[email protected]> * 10532-FIX: failing test case due to legendItem.text being undefined Co-authored-by: Nirav Chavda <[email protected]> * 10532-FIX: Update compression size Co-authored-by: kartik <[email protected]> Co-authored-by: Nirav Chavda <[email protected]>
- Loading branch information
1 parent
d4e106c
commit 1253ced
Showing
5 changed files
with
138 additions
and
8 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
28 changes: 28 additions & 0 deletions
28
test/fixtures/plugin.legend/legend-doughnut-right-center-mulitiline-labels.json
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,28 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["Example Label", ["I like these colors", "Red", "Green", "Blue", "Yellow"], "Example Label", "Example Label", "Example Label"], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"plugins": { | ||
"legend": { | ||
"position": "right", | ||
"align": "center" | ||
} | ||
} | ||
} | ||
}, | ||
"options": { | ||
"spriteText": true, | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Binary file added
BIN
+18.6 KB
test/fixtures/plugin.legend/legend-doughnut-right-center-mulitiline-labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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