提交 f5e9232b 编写于 作者: K kener

axis label textStyle支持align、baseline

上级 4f227b57
...@@ -365,8 +365,8 @@ define(function (require) { ...@@ -365,8 +365,8 @@ define(function (require) {
color : dataTextStyle.color, color : dataTextStyle.color,
text : this._labelData[i].value || this._labelData[i], text : this._labelData[i].value || this._labelData[i],
textFont : this.getFont(dataTextStyle), textFont : this.getFont(dataTextStyle),
textAlign : 'center', textAlign : dataTextStyle.align || 'center',
textBaseline : baseLine textBaseline : dataTextStyle.baseline || baseLine
} }
}; };
if (rotate) { if (rotate) {
...@@ -416,13 +416,14 @@ define(function (require) { ...@@ -416,13 +416,14 @@ define(function (require) {
color : dataTextStyle.color, color : dataTextStyle.color,
text : this._labelData[i].value || this._labelData[i], text : this._labelData[i].value || this._labelData[i],
textFont : this.getFont(dataTextStyle), textFont : this.getFont(dataTextStyle),
textAlign : align, textAlign : dataTextStyle.align || align,
textBaseline : (i === 0 && this.option.name !== '') textBaseline : dataTextStyle.baseline
? 'bottom' || (i === 0 && this.option.name !== '')
: (i == (dataLength - 1) ? 'bottom'
&& this.option.name !== '') : (i == (dataLength - 1)
? 'top' && this.option.name !== '')
: 'middle' ? 'top'
: 'middle'
} }
}; };
......
...@@ -224,8 +224,8 @@ define(function (require) { ...@@ -224,8 +224,8 @@ define(function (require) {
? textStyle.color(data[i]) : textStyle.color, ? textStyle.color(data[i]) : textStyle.color,
text : this._valueLabel[i], text : this._valueLabel[i],
textFont : this.getFont(textStyle), textFont : this.getFont(textStyle),
textAlign : 'center', textAlign : textStyle.align || 'center',
textBaseline : baseLine textBaseline : textStyle.baseline || baseLine
} }
}; };
if (rotate) { if (rotate) {
...@@ -267,13 +267,14 @@ define(function (require) { ...@@ -267,13 +267,14 @@ define(function (require) {
? textStyle.color(data[i]) : textStyle.color, ? textStyle.color(data[i]) : textStyle.color,
text : this._valueLabel[i], text : this._valueLabel[i],
textFont : this.getFont(textStyle), textFont : this.getFont(textStyle),
textAlign : align, textAlign : textStyle.align || align,
textBaseline : (i === 0 && this.option.name !== '') textBaseline : textStyle.baseline
? 'bottom' || (i === 0 && this.option.name !== '')
: (i == (dataLength - 1) ? 'bottom'
&& this.option.name !== '') : (i == (dataLength - 1)
? 'top' && this.option.name !== '')
: 'middle' ? 'top'
: 'middle'
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册