forked from chartjs/Chart.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement legend.align: 'start', 'center', 'end' (chartjs#6141)
New `options.legend.align`config option for controlling alignment of legend blocks in horizontal/vertical legends.
- Loading branch information
1 parent
d078119
commit 2533cc0
Showing
39 changed files
with
491 additions
and
367 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
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-bottom-center-mulitiline.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 20, 10], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "bottom", | ||
"align": "center" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Binary file added
BIN
+12.3 KB
test/fixtures/plugin.legend/legend-doughnut-bottom-center-mulitiline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-bottom-center-single.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": [""], | ||
"datasets": [{ | ||
"data": [10], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "bottom", | ||
"align": "center" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-bottom-end-mulitiline.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 40, 50, 60, 70, 10], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "bottom", | ||
"align": "end" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Binary file added
BIN
+11.4 KB
test/fixtures/plugin.legend/legend-doughnut-bottom-end-mulitiline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-bottom-start-mulitiline.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 40, 50, 60, 70, 10], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "bottom", | ||
"align": "start" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Binary file added
BIN
+11.3 KB
test/fixtures/plugin.legend/legend-doughnut-bottom-start-mulitiline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-left-center-mulitiline.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 40, 50, 60, 70, 10, 20, 30], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "left", | ||
"align": "center" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Binary file added
BIN
+14.3 KB
test/fixtures/plugin.legend/legend-doughnut-left-center-mulitiline.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-left-center-single.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": [""], | ||
"datasets": [{ | ||
"data": [10], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "left", | ||
"align": "center" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
test/fixtures/plugin.legend/legend-doughnut-left-default-center.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,24 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["", "", "", "", "", ""], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "left" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions
25
test/fixtures/plugin.legend/legend-doughnut-left-end-mulitiline.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,25 @@ | ||
{ | ||
"config": { | ||
"type": "doughnut", | ||
"data": { | ||
"labels": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], | ||
"datasets": [{ | ||
"data": [10, 20, 30, 40, 50, 60, 70, 10, 20, 30, 40, 50, 60, 70, 10, 20, 30], | ||
"backgroundColor": "#00ff00", | ||
"borderWidth": 0 | ||
}] | ||
}, | ||
"options": { | ||
"legend": { | ||
"position": "left", | ||
"align": "end" | ||
} | ||
} | ||
}, | ||
"options": { | ||
"canvas": { | ||
"height": 256, | ||
"width": 512 | ||
} | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.