From faf6a4b246185744478833e4b9149973c9e453fd Mon Sep 17 00:00:00 2001 From: kener Date: Mon, 27 Jan 2014 14:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E5=80=BC=E8=BD=B4=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/doc.html | 10 ++++++++-- src/component/valueAxis.js | 10 ++++++++++ src/config.js | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/doc/doc.html b/doc/doc.html index 79df642ba..c467fe862 100644 --- a/doc/doc.html +++ b/doc/doc.html @@ -1503,6 +1503,12 @@ feature : { 数值型 坐标轴名称位置,默认为'end',可选为:'start' | 'end' + + {Object} nameTextStyle + {} + 数值型 + 坐标轴名称文字样式,默认取全局配置,颜色跟随axisLine主色,可设 + {Boolean} boundaryGap true @@ -1771,7 +1777,7 @@ feature : { {boolean} onGap null 类目型 - 小标记是否显示为间隔,默认等于boundaryGap + 分隔线是否显示为间隔,默认等于boundaryGap {Object} lineStyle @@ -1800,7 +1806,7 @@ feature : { {boolean} onGap null 类目型 - 小标记是否显示为间隔,默认等于boundaryGap + 分隔区域是否显示为间隔,默认等于boundaryGap {Object} areaStyle diff --git a/src/component/valueAxis.js b/src/component/valueAxis.js index 3648f7dca..f44e67c14 100644 --- a/src/component/valueAxis.js +++ b/src/component/valueAxis.js @@ -96,6 +96,16 @@ define(function (require) { if (option.name !== '') { axShape.style.text = option.name; axShape.style.textPosition = option.nameLocation; + axShape.style.textFont = self.getFont(option.nameTextStyle); + if (option.nameTextStyle.align) { + axShape.style.textAlign = option.nameTextStyle.align; + } + if (option.nameTextStyle.baseline) { + axShape.style.textBaseline = option.nameTextStyle.baseline; + } + if (option.nameTextStyle.color) { + axShape.style.textColor = option.nameTextStyle.color; + } } axShape.style.strokeColor = option.axisLine.lineStyle.color; diff --git a/src/config.js b/src/config.js index 08255f524..7fa22226e 100644 --- a/src/config.js +++ b/src/config.js @@ -300,6 +300,7 @@ define(function() { position: 'left', // 位置 name: '', // 坐标轴名字,默认为空 nameLocation: 'end', // 坐标轴名字位置,支持'start' | 'end' + nameTextStyle: {}, // 坐标轴文字样式,默认取全局样式 boundaryGap: [0, 0], // 数值起始和结束两端空白策略 // min: null, // 最小值 // max: null, // 最大值 -- GitLab