Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
e2686d57
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e2686d57
编写于
8月 08, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak emphasis text style.
上级
10d3543b
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
107 addition
and
52 deletion
+107
-52
src/chart/bar/BarView.js
src/chart/bar/BarView.js
+2
-2
src/chart/bar/PictorialBarView.js
src/chart/bar/PictorialBarView.js
+1
-1
src/chart/bar/helper.js
src/chart/bar/helper.js
+6
-5
src/chart/custom.js
src/chart/custom.js
+1
-1
src/chart/heatmap/HeatmapView.js
src/chart/heatmap/HeatmapView.js
+1
-1
src/chart/helper/Line.js
src/chart/helper/Line.js
+1
-1
src/chart/helper/Symbol.js
src/chart/helper/Symbol.js
+2
-2
src/chart/helper/labelHelper.js
src/chart/helper/labelHelper.js
+2
-2
src/chart/radar/RadarView.js
src/chart/radar/RadarView.js
+16
-12
src/chart/treemap/Breadcrumb.js
src/chart/treemap/Breadcrumb.js
+1
-1
src/chart/treemap/TreemapView.js
src/chart/treemap/TreemapView.js
+4
-4
src/component/marker/MarkAreaView.js
src/component/marker/MarkAreaView.js
+3
-3
src/util/graphic.js
src/util/graphic.js
+57
-15
test/line.html
test/line.html
+10
-2
未找到文件。
src/chart/bar/BarView.js
浏览文件 @
e2686d57
...
@@ -181,7 +181,7 @@ define(function (require) {
...
@@ -181,7 +181,7 @@ define(function (require) {
function
removeRect
(
dataIndex
,
animationModel
,
el
)
{
function
removeRect
(
dataIndex
,
animationModel
,
el
)
{
// Not show text when animating
// Not show text when animating
el
.
style
.
text
=
''
;
el
.
style
.
text
=
null
;
graphic
.
updateProps
(
el
,
{
graphic
.
updateProps
(
el
,
{
shape
:
{
shape
:
{
width
:
0
width
:
0
...
@@ -193,7 +193,7 @@ define(function (require) {
...
@@ -193,7 +193,7 @@ define(function (require) {
function
removeSector
(
dataIndex
,
animationModel
,
el
)
{
function
removeSector
(
dataIndex
,
animationModel
,
el
)
{
// Not show text when animating
// Not show text when animating
el
.
style
.
text
=
''
;
el
.
style
.
text
=
null
;
graphic
.
updateProps
(
el
,
{
graphic
.
updateProps
(
el
,
{
shape
:
{
shape
:
{
r
:
el
.
shape
.
r0
r
:
el
.
shape
.
r0
...
...
src/chart/bar/PictorialBarView.js
浏览文件 @
e2686d57
...
@@ -674,7 +674,7 @@ define(function (require) {
...
@@ -674,7 +674,7 @@ define(function (require) {
function
removeBar
(
data
,
dataIndex
,
animationModel
,
bar
)
{
function
removeBar
(
data
,
dataIndex
,
animationModel
,
bar
)
{
// Not show text when animating
// Not show text when animating
var
labelRect
=
bar
.
__pictorialBarRect
;
var
labelRect
=
bar
.
__pictorialBarRect
;
labelRect
&&
(
labelRect
.
style
.
text
=
''
);
labelRect
&&
(
labelRect
.
style
.
text
=
null
);
var
pathes
=
[];
var
pathes
=
[];
eachPath
(
bar
,
function
(
path
)
{
eachPath
(
bar
,
function
(
path
)
{
...
...
src/chart/bar/helper.js
浏览文件 @
e2686d57
...
@@ -22,7 +22,7 @@ define(function (require) {
...
@@ -22,7 +22,7 @@ define(function (require) {
);
);
}
}
else
{
else
{
normalStyle
.
text
=
''
;
normalStyle
.
text
=
null
;
}
}
if
(
hoverLabelModel
.
get
(
'
show
'
))
{
if
(
hoverLabelModel
.
get
(
'
show
'
))
{
...
@@ -32,16 +32,17 @@ define(function (require) {
...
@@ -32,16 +32,17 @@ define(function (require) {
seriesModel
.
getFormattedLabel
(
dataIndex
,
'
emphasis
'
),
seriesModel
.
getFormattedLabel
(
dataIndex
,
'
emphasis
'
),
seriesModel
.
getRawValue
(
dataIndex
)
seriesModel
.
getRawValue
(
dataIndex
)
),
),
labelPositionOutside
labelPositionOutside
,
true
);
);
}
}
else
{
else
{
hoverStyle
.
text
=
''
;
hoverStyle
.
text
=
null
;
}
}
};
};
function
setLabel
(
style
,
model
,
color
,
labelText
,
labelPositionOutside
)
{
function
setLabel
(
style
,
model
,
color
,
labelText
,
labelPositionOutside
,
isEmphasis
)
{
graphic
.
setText
(
style
,
model
,
color
);
graphic
.
setText
(
style
,
model
,
color
,
isEmphasis
);
style
.
text
=
labelText
;
style
.
text
=
labelText
;
if
(
style
.
textPosition
===
'
outside
'
)
{
if
(
style
.
textPosition
===
'
outside
'
)
{
style
.
textPosition
=
labelPositionOutside
;
style
.
textPosition
=
labelPositionOutside
;
...
...
src/chart/custom.js
浏览文件 @
e2686d57
...
@@ -362,7 +362,7 @@ define(function (require) {
...
@@ -362,7 +362,7 @@ define(function (require) {
labelHelper
.
setTextToStyle
(
labelHelper
.
setTextToStyle
(
data
,
dataIndexInside
,
currLabelValueDim
,
itemStyle
,
data
,
dataIndexInside
,
currLabelValueDim
,
itemStyle
,
customSeries
,
currLabelEmphasisModel
,
currVisualColor
customSeries
,
currLabelEmphasisModel
,
currVisualColor
,
true
);
);
extra
&&
zrUtil
.
extend
(
itemStyle
,
extra
);
extra
&&
zrUtil
.
extend
(
itemStyle
,
extra
);
...
...
src/chart/heatmap/HeatmapView.js
浏览文件 @
e2686d57
...
@@ -196,7 +196,7 @@ define(function (require) {
...
@@ -196,7 +196,7 @@ define(function (require) {
style
.
text
=
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
)
||
defaultText
;
style
.
text
=
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
)
||
defaultText
;
}
}
if
(
hoverLabelModel
.
getShallow
(
'
show
'
))
{
if
(
hoverLabelModel
.
getShallow
(
'
show
'
))
{
graphic
.
setText
(
hoverStl
,
hoverLabelModel
);
graphic
.
setText
(
hoverStl
,
hoverLabelModel
,
null
,
true
);
hoverStl
.
text
=
seriesModel
.
getFormattedLabel
(
idx
,
'
emphasis
'
)
||
defaultText
;
hoverStl
.
text
=
seriesModel
.
getFormattedLabel
(
idx
,
'
emphasis
'
)
||
defaultText
;
}
}
...
...
src/chart/helper/Line.js
浏览文件 @
e2686d57
...
@@ -338,7 +338,7 @@ define(function (require) {
...
@@ -338,7 +338,7 @@ define(function (require) {
}
}
else
{
else
{
label
.
hoverStyle
=
{
label
.
hoverStyle
=
{
text
:
''
text
:
null
};
};
}
}
...
...
src/chart/helper/Symbol.js
浏览文件 @
e2686d57
...
@@ -228,7 +228,7 @@ define(function (require) {
...
@@ -228,7 +228,7 @@ define(function (require) {
data
,
idx
,
valueDim
,
elStyle
,
seriesModel
,
labelModel
,
color
data
,
idx
,
valueDim
,
elStyle
,
seriesModel
,
labelModel
,
color
);
);
labelHelper
.
setTextToStyle
(
labelHelper
.
setTextToStyle
(
data
,
idx
,
valueDim
,
hoverItemStyle
,
seriesModel
,
hoverLabelModel
,
color
data
,
idx
,
valueDim
,
hoverItemStyle
,
seriesModel
,
hoverLabelModel
,
color
,
true
);
);
symbolPath
.
off
(
'
mouseover
'
)
symbolPath
.
off
(
'
mouseover
'
)
...
@@ -269,7 +269,7 @@ define(function (require) {
...
@@ -269,7 +269,7 @@ define(function (require) {
// Avoid mistaken hover when fading out
// Avoid mistaken hover when fading out
this
.
silent
=
symbolPath
.
silent
=
true
;
this
.
silent
=
symbolPath
.
silent
=
true
;
// Not show text when animating
// Not show text when animating
symbolPath
.
style
.
text
=
''
;
symbolPath
.
style
.
text
=
null
;
graphic
.
updateProps
(
symbolPath
,
{
graphic
.
updateProps
(
symbolPath
,
{
scale
:
[
0
,
0
]
scale
:
[
0
,
0
]
},
this
.
_seriesModel
,
this
.
dataIndex
,
cb
);
},
this
.
_seriesModel
,
this
.
dataIndex
,
cb
);
...
...
src/chart/helper/labelHelper.js
浏览文件 @
e2686d57
...
@@ -31,10 +31,10 @@ define(function (require) {
...
@@ -31,10 +31,10 @@ define(function (require) {
};
};
helper
.
setTextToStyle
=
function
(
helper
.
setTextToStyle
=
function
(
data
,
dataIndex
,
valueDim
,
elStyle
,
seriesModel
,
labelModel
,
color
data
,
dataIndex
,
valueDim
,
elStyle
,
seriesModel
,
labelModel
,
color
,
isEmphasis
)
{
)
{
if
(
valueDim
!=
null
&&
labelModel
.
getShallow
(
'
show
'
))
{
if
(
valueDim
!=
null
&&
labelModel
.
getShallow
(
'
show
'
))
{
graphic
.
setText
(
elStyle
,
labelModel
,
color
);
graphic
.
setText
(
elStyle
,
labelModel
,
color
,
isEmphasis
);
elStyle
.
text
=
zrUtil
.
retrieve
(
elStyle
.
text
=
zrUtil
.
retrieve
(
seriesModel
.
getFormattedLabel
(
dataIndex
,
'
normal
'
),
seriesModel
.
getFormattedLabel
(
dataIndex
,
'
normal
'
),
data
.
get
(
valueDim
,
dataIndex
)
data
.
get
(
valueDim
,
dataIndex
)
...
...
src/chart/radar/RadarView.js
浏览文件 @
e2686d57
...
@@ -174,21 +174,25 @@ define(function (require) {
...
@@ -174,21 +174,25 @@ define(function (require) {
var
defaultText
=
data
.
get
(
data
.
dimensions
[
symbolPath
.
__dimIdx
],
idx
);
var
defaultText
=
data
.
get
(
data
.
dimensions
[
symbolPath
.
__dimIdx
],
idx
);
graphic
.
setText
(
symbolPath
.
style
,
labelModel
,
color
);
graphic
.
setText
(
symbolPath
.
style
,
labelModel
,
color
);
symbolPath
.
setStyle
({
symbolPath
.
setStyle
({
text
:
labelModel
.
get
(
'
show
'
)
?
zrUtil
.
retrieve
(
text
:
labelModel
.
get
(
'
show
'
)
?
zrUtil
.
retrieve
(
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
,
null
,
symbolPath
.
__dimIdx
),
defaultText
)
:
null
});
graphic
.
setText
(
symbolPath
.
hoverStyle
,
labelHoverModel
,
color
,
true
);
symbolPath
.
hoverStyle
.
text
=
labelHoverModel
.
get
(
'
show
'
)
?
zrUtil
.
retrieve
(
seriesModel
.
getFormattedLabel
(
seriesModel
.
getFormattedLabel
(
idx
,
'
normal
'
,
null
,
symbolPath
.
__dimIdx
idx
,
'
emphasis
'
,
null
,
symbolPath
.
__dimIdx
),
),
defaultText
defaultText
)
:
''
)
});
:
null
;
graphic
.
setText
(
symbolPath
.
hoverStyle
,
labelHoverModel
,
color
);
symbolPath
.
hoverStyle
.
text
=
labelHoverModel
.
get
(
'
show
'
)
?
zrUtil
.
retrieve
(
seriesModel
.
getFormattedLabel
(
idx
,
'
emphasis
'
,
null
,
symbolPath
.
__dimIdx
),
defaultText
)
:
''
;
});
});
function
onEmphasis
()
{
function
onEmphasis
()
{
...
...
src/chart/treemap/Breadcrumb.js
浏览文件 @
e2686d57
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
if
(
totalWidth
>
availableSize
.
width
)
{
if
(
totalWidth
>
availableSize
.
width
)
{
totalWidth
-=
itemWidth
-
emptyItemWidth
;
totalWidth
-=
itemWidth
-
emptyItemWidth
;
itemWidth
=
emptyItemWidth
;
itemWidth
=
emptyItemWidth
;
text
=
''
;
text
=
null
;
}
}
var
el
=
new
graphic
.
Polygon
({
var
el
=
new
graphic
.
Polygon
({
...
...
src/chart/treemap/TreemapView.js
浏览文件 @
e2686d57
...
@@ -741,7 +741,7 @@
...
@@ -741,7 +741,7 @@
}
}
// For old bg.
// For old bg.
else
{
else
{
normalStyle
.
text
=
emphasisStyle
.
text
=
''
;
normalStyle
.
text
=
emphasisStyle
.
text
=
null
;
}
}
bg
.
setStyle
(
normalStyle
);
bg
.
setStyle
(
normalStyle
);
...
@@ -818,14 +818,14 @@
...
@@ -818,14 +818,14 @@
);
);
setText
(
setText
(
text
,
emphasisStyle
,
nodeModel
,
upperLabelRect
?
PATH_UPPERLABEL_EMPHASIS
:
PATH_LABEL_EMPHASIS
,
text
,
emphasisStyle
,
nodeModel
,
upperLabelRect
?
PATH_UPPERLABEL_EMPHASIS
:
PATH_LABEL_EMPHASIS
,
visualColor
,
width
,
height
,
upperLabelRect
visualColor
,
width
,
height
,
upperLabelRect
,
true
);
);
}
}
function
setText
(
text
,
style
,
nodeModel
,
labelPath
,
visualColor
,
width
,
height
,
upperLabelRect
)
{
function
setText
(
text
,
style
,
nodeModel
,
labelPath
,
visualColor
,
width
,
height
,
upperLabelRect
,
isEmphasis
)
{
var
labelModel
=
nodeModel
.
getModel
(
labelPath
);
var
labelModel
=
nodeModel
.
getModel
(
labelPath
);
graphic
.
setText
(
style
,
labelModel
,
visualColor
);
graphic
.
setText
(
style
,
labelModel
,
visualColor
,
isEmphasis
);
upperLabelRect
&&
(
style
.
textPositionRect
=
zrUtil
.
clone
(
upperLabelRect
));
upperLabelRect
&&
(
style
.
textPositionRect
=
zrUtil
.
clone
(
upperLabelRect
));
...
...
src/component/marker/MarkAreaView.js
浏览文件 @
e2686d57
...
@@ -234,18 +234,18 @@ define(function (require) {
...
@@ -234,18 +234,18 @@ define(function (require) {
);
);
}
}
else
{
else
{
polygon
.
style
.
text
=
''
;
polygon
.
style
.
text
=
null
;
}
}
if
(
labelHoverModel
.
getShallow
(
'
show
'
))
{
if
(
labelHoverModel
.
getShallow
(
'
show
'
))
{
graphic
.
setText
(
polygon
.
hoverStyle
,
labelHoverModel
,
textColor
);
graphic
.
setText
Style
(
polygon
.
hoverStyle
,
labelHoverModel
,
textColor
,
true
);
polygon
.
hoverStyle
.
text
=
zrUtil
.
retrieve
(
polygon
.
hoverStyle
.
text
=
zrUtil
.
retrieve
(
maModel
.
getFormattedLabel
(
idx
,
'
emphasis
'
),
maModel
.
getFormattedLabel
(
idx
,
'
emphasis
'
),
defaultValue
defaultValue
);
);
}
}
else
{
else
{
polygon
.
hoverStyle
.
text
=
''
;
polygon
.
hoverStyle
.
text
=
null
;
}
}
graphic
.
setHoverStyle
(
polygon
,
{});
graphic
.
setHoverStyle
(
polygon
,
{});
...
...
src/util/graphic.js
浏览文件 @
e2686d57
...
@@ -263,11 +263,11 @@ define(function(require) {
...
@@ -263,11 +263,11 @@ define(function(require) {
// }
// }
// }
// }
// },
// },
// where properties of `emphasis` may not appear in `normal`. We previously use
// where properties of `emphasis` may not appear in `normal`. We previously use
// module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`.
// module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`.
// But consider rich text, it is impossible to cover all properties in merge.
// But consider rich text, it is impossible to cover all properties in merge.
// So we use merge mode when setting style here, where only properties that
// So we use merge mode when setting style here, where only properties that
// is not `null/undefined` can be set. The disadventage: null/undefined can not
// is not `null/undefined` can be set. The disadventage: null/undefined can not
// be used to remove style any more in `emphasis`.
// be used to remove style any more in `emphasis`.
el
.
style
.
extendFrom
(
el
.
__hoverStl
);
el
.
style
.
extendFrom
(
el
.
__hoverStl
);
el
.
dirty
(
false
);
el
.
dirty
(
false
);
...
@@ -290,7 +290,7 @@ define(function(require) {
...
@@ -290,7 +290,7 @@ define(function(require) {
el
.
__zr
&&
el
.
__zr
.
removeHover
(
el
);
el
.
__zr
&&
el
.
__zr
.
removeHover
(
el
);
}
}
else
{
else
{
// Consider null/undefined value, should use
// Consider null/undefined value, should use
// `setStyle` but not `extendFrom(stl, true)`.
// `setStyle` but not `extendFrom(stl, true)`.
normalStl
&&
el
.
setStyle
(
normalStl
);
normalStl
&&
el
.
setStyle
(
normalStl
);
el
.
z2
-=
1
;
el
.
z2
-=
1
;
...
@@ -416,8 +416,8 @@ define(function(require) {
...
@@ -416,8 +416,8 @@ define(function(require) {
/**
/**
* Set basic textStyle properties.
* Set basic textStyle properties.
* @param {Object|module:zrender/graphic/Style} style
* @param {Object|module:zrender/graphic/Style} style
* @param {Object} specifiedTextStyle Can be overrided by settings in model.
* @param {module:echarts/model/Model} model
* @param {module:echarts/model/Model} model
* @param {Object} [specifiedTextStyle] Can be overrided by settings in model.
* @param {Object} [opt] See `opt` of `setTextStyleCommon`.
* @param {Object} [opt] See `opt` of `setTextStyleCommon`.
*/
*/
graphic
.
setTextStyle
=
function
(
style
,
textStyleModel
,
specifiedTextStyle
,
opt
)
{
graphic
.
setTextStyle
=
function
(
style
,
textStyleModel
,
specifiedTextStyle
,
opt
)
{
...
@@ -433,12 +433,14 @@ define(function(require) {
...
@@ -433,12 +433,14 @@ define(function(require) {
* @param {Object} textStyle
* @param {Object} textStyle
* @param {module:echarts/model/Model} labelModel
* @param {module:echarts/model/Model} labelModel
* @param {string} color
* @param {string} color
* @param {boolean} isEmphasis
*/
*/
graphic
.
setText
=
function
(
textStyle
,
labelModel
,
color
)
{
graphic
.
setText
=
function
(
textStyle
,
labelModel
,
color
,
isEmphasis
)
{
setTextStyleCommon
(
textStyle
,
labelModel
,
{
isRectText
:
true
});
setTextStyleCommon
(
textStyle
,
labelModel
,
{
isRectText
:
true
,
textStyle
.
textFill
=
textStyle
.
textFill
forMerge
:
isEmphasis
,
||
(
textStyle
.
textPosition
.
indexOf
(
'
inside
'
)
>=
0
?
'
white
'
:
color
);
defaultTextColor
:
color
});
};
};
/**
/**
...
@@ -446,18 +448,23 @@ define(function(require) {
...
@@ -446,18 +448,23 @@ define(function(require) {
* disableBox: boolean, Whether diable drawing box of block (outer most).
* disableBox: boolean, Whether diable drawing box of block (outer most).
* isRectText: boolean,
* isRectText: boolean,
* autoColor: string, specify a color when color is 'auto',
* autoColor: string, specify a color when color is 'auto',
* for textFill, textStroke, textBackgroundColor, and textBorderColor
* for textFill, textStroke, textBackgroundColor, and textBorderColor,
* forceRich: boolean
* defaultTextColor: defaultTextColor,
* forceRich: boolean,
* forMerge: boolean
* }
* }
*/
*/
function
setTextStyleCommon
(
textStyle
,
textStyleModel
,
opt
)
{
function
setTextStyleCommon
(
textStyle
,
textStyleModel
,
opt
)
{
// Consider there will be abnormal when merge hover style to normal style if given default value.
var
forMerge
=
opt
&&
opt
.
forMerge
;
if
(
opt
&&
opt
.
isRectText
)
{
if
(
opt
&&
opt
.
isRectText
)
{
textStyle
.
textPosition
=
textStyleModel
.
getShallow
(
'
position
'
)
||
'
inside
'
;
textStyle
.
textPosition
=
textStyleModel
.
getShallow
(
'
position
'
)
||
(
forMerge
?
null
:
'
inside
'
)
;
textStyle
.
textOffset
=
textStyleModel
.
getShallow
(
'
offset
'
);
textStyle
.
textOffset
=
textStyleModel
.
getShallow
(
'
offset
'
);
var
labelRotate
=
textStyleModel
.
getShallow
(
'
rotate
'
);
var
labelRotate
=
textStyleModel
.
getShallow
(
'
rotate
'
);
labelRotate
!=
null
&&
(
labelRotate
*=
Math
.
PI
/
180
);
labelRotate
!=
null
&&
(
labelRotate
*=
Math
.
PI
/
180
);
textStyle
.
textRotation
=
labelRotate
;
textStyle
.
textRotation
=
labelRotate
;
textStyle
.
textDistance
=
textStyleModel
.
getShallow
(
'
distance
'
)
||
5
;
textStyle
.
textDistance
=
textStyleModel
.
getShallow
(
'
distance
'
)
||
(
forMerge
?
null
:
5
)
;
}
}
var
ecModel
=
textStyleModel
.
ecModel
;
var
ecModel
=
textStyleModel
.
ecModel
;
...
@@ -488,7 +495,15 @@ define(function(require) {
...
@@ -488,7 +495,15 @@ define(function(require) {
}
}
function
setTokenTextStyle
(
textStyle
,
textStyleModel
,
globalTextStyle
,
opt
,
isBlock
)
{
function
setTokenTextStyle
(
textStyle
,
textStyleModel
,
globalTextStyle
,
opt
,
isBlock
)
{
textStyle
.
textFill
=
getAutoColor
(
textStyleModel
.
getTextColor
(),
opt
);
var
textPosition
=
textStyle
.
textPosition
;
textStyle
.
textFill
=
getAutoColor
(
textStyleModel
.
getTextColor
(),
opt
)
||
(
(
opt
&&
opt
.
forMerge
)
?
null
:
(
textPosition
&&
textPosition
.
indexOf
(
'
inside
'
)
>=
0
)
?
'
#fff
'
:
(
opt
&&
opt
.
defaultTextColor
)
);
textStyle
.
textStroke
=
getAutoColor
(
textStyle
.
textStroke
=
getAutoColor
(
textStyleModel
.
getShallow
(
'
textBorderColor
'
)
textStyleModel
.
getShallow
(
'
textBorderColor
'
)
||
(
globalTextStyle
&&
globalTextStyle
.
textBorderColor
)
||
(
globalTextStyle
&&
globalTextStyle
.
textBorderColor
)
...
@@ -762,5 +777,32 @@ define(function(require) {
...
@@ -762,5 +777,32 @@ define(function(require) {
}
}
};
};
/**
* @param {string} iconStr Support 'image://' or 'path://' or direct svg path.
* @param {Object} [opt] Properties of `module:zrender/Element`, except `style`.
* @param {Object} [rect] {x, y, width, height}
* @return {module:zrender/Element} Icon path or image element.
*/
graphic
.
createIcon
=
function
(
iconStr
,
opt
,
rect
)
{
opt
=
zrUtil
.
extend
({
rectHover
:
true
},
opt
);
var
style
=
opt
.
style
=
{
strokeNoScale
:
true
};
rect
=
rect
||
{
x
:
-
1
,
y
:
-
1
,
width
:
2
,
height
:
2
};
return
iconStr
.
indexOf
(
'
image://
'
)
===
0
?
(
style
.
image
=
iconStr
.
slice
(
8
),
zrUtil
.
defaults
(
style
,
rect
),
new
graphic
.
Image
(
opt
)
)
:
(
graphic
.
makePath
(
iconStr
.
replace
(
'
path://
'
,
''
),
opt
,
rect
,
'
center
'
)
);
};
return
graphic
;
return
graphic
;
});
});
test/line.html
浏览文件 @
e2686d57
...
@@ -24,11 +24,13 @@
...
@@ -24,11 +24,13 @@
'
echarts/component/legend
'
,
'
echarts/component/legend
'
,
'
echarts/component/grid
'
,
'
echarts/component/grid
'
,
'
echarts/component/tooltip
'
,
'
echarts/component/tooltip
'
,
'
echarts/component/dataZoomInside
'
'
echarts/component/dataZoomInside
'
,
'
zrender/svg/svg
'
],
function
(
echarts
)
{
],
function
(
echarts
)
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
null
,
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
null
,
{
renderer
:
'
canvas
'
renderer
:
'
canvas
'
// renderer: 'svg'
});
});
var
xAxisData
=
[];
var
xAxisData
=
[];
...
@@ -130,9 +132,15 @@
...
@@ -130,9 +132,15 @@
type
:
'
line
'
,
type
:
'
line
'
,
stack
:
'
all
'
,
stack
:
'
all
'
,
symbol
:
'
circle
'
,
symbol
:
'
circle
'
,
symbolSize
:
1
0
,
symbolSize
:
4
0
,
data
:
data1
,
data
:
data1
,
itemStyle
:
itemStyle
,
itemStyle
:
itemStyle
,
label
:
{
normal
:
{
show
:
true
,
fontSize
:
12
}
},
lineStyle
:
{
lineStyle
:
{
normal
:
{
normal
:
{
shadowBlur
:
4
,
shadowBlur
:
4
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录