We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a540b0e commit 4130c31Copy full SHA for 4130c31
src/core/core.scale.js
@@ -875,11 +875,15 @@ module.exports = function(Chart) {
875
876
var label = itemToDraw.label;
877
if (helpers.isArray(label)) {
878
- for (var i = 0, y = 0; i < label.length; ++i) {
+ var lineCount = label.length;
879
+ var lineHeight = tickFont.size * 1.5;
880
+ var y = me.isHorizontal() ? 0 : -lineHeight * (lineCount - 1) / 2;
881
+
882
+ for (var i = 0; i < lineCount; ++i) {
883
// We just make sure the multiline element is a string here..
884
context.fillText('' + label[i], 0, y);
885
// apply same lineSpacing as calculated @ L#320
- y += (tickFont.size * 1.5);
886
+ y += lineHeight;
887
}
888
} else {
889
context.fillText(label, 0, 0);
0 commit comments