From 1f40f09a8e648492010d0c0090c4004667ad22f3 Mon Sep 17 00:00:00 2001 From: Eliz Date: Sat, 5 Oct 2019 02:13:47 +0300 Subject: [PATCH] Replace labelAlign with align --- docs/axes/labelling.md | 2 +- src/core/core.scale.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/axes/labelling.md b/docs/axes/labelling.md index aa7a2b6b1ef..f92f9be42f2 100644 --- a/docs/axes/labelling.md +++ b/docs/axes/labelling.md @@ -9,7 +9,7 @@ The scale label configuration is nested under the scale configuration in the `sc | Name | Type | Default | Description | ---- | ---- | ------- | ----------- | `display` | `boolean` | `false` | If true, display the axis title. -| `labelAlign` | `string` | `'center'` | Alignment of the axis title. Possible options are `'start'`, `'center'` and `'end'` +| `align` | `string` | `'center'` | Alignment of the axis title. Possible options are `'start'`, `'center'` and `'end'` | `labelString` | `string` | `''` | The text for the title. (i.e. "# of People" or "Response Choices"). | `lineHeight` | number|string | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)). | `fontColor` | `Color` | `'#666'` | Font color for scale title. diff --git a/src/core/core.scale.js b/src/core/core.scale.js index ceefa27dbb4..731e1d54727 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -1205,14 +1205,14 @@ var Scale = Element.extend({ var scaleLabelFont = helpers.options._parseFont(scaleLabel); var scaleLabelPadding = helpers.options.toPadding(scaleLabel.padding); var halfLineHeight = scaleLabelFont.lineHeight / 2; - var scaleLabelAlign = scaleLabel.labelAlign; + var scaleAlign = scaleLabel.align; var position = options.position; var rotation = 0; var scaleLabelX, scaleLabelY, textAlign; var isReverse = me.options.ticks.reverse; if (me.isHorizontal()) { - switch (scaleLabelAlign) { + switch (scaleAlign) { case 'start': scaleLabelX = me.left; textAlign = isReverse ? 'right' : 'left'; @@ -1234,7 +1234,7 @@ var Scale = Element.extend({ scaleLabelX = isLeft ? me.left + halfLineHeight + scaleLabelPadding.top : me.right - halfLineHeight - scaleLabelPadding.top; - switch (scaleLabelAlign) { + switch (scaleAlign) { case 'start': scaleLabelY = me.top + (startsAtBottom ? me.height : 0); textAlign = (startsAtBottom ^ !isLeft) ? 'left' : 'right';