Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
强哥很慌张
Echarts
提交
aee0b1a0
E
Echarts
项目概览
强哥很慌张
/
Echarts
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
aee0b1a0
编写于
7月 29, 2020
作者:
S
susiwen8
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tooltip style
上级
4399d1f5
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
38 addition
and
26 deletion
+38
-26
src/chart/bar/BarView.ts
src/chart/bar/BarView.ts
+1
-1
src/chart/map/MapSeries.ts
src/chart/map/MapSeries.ts
+1
-2
src/chart/radar/RadarSeries.ts
src/chart/radar/RadarSeries.ts
+4
-3
src/chart/sankey/SankeySeries.ts
src/chart/sankey/SankeySeries.ts
+6
-2
src/chart/themeRiver/ThemeRiverSeries.ts
src/chart/themeRiver/ThemeRiverSeries.ts
+1
-1
src/chart/tree/TreeSeries.ts
src/chart/tree/TreeSeries.ts
+3
-1
src/chart/treemap/TreemapSeries.ts
src/chart/treemap/TreemapSeries.ts
+3
-1
src/component/geo/GeoView.ts
src/component/geo/GeoView.ts
+1
-1
src/component/marker/MarkPointView.ts
src/component/marker/MarkPointView.ts
+1
-1
src/component/marker/MarkerModel.ts
src/component/marker/MarkerModel.ts
+4
-4
src/component/tooltip/TooltipModel.ts
src/component/tooltip/TooltipModel.ts
+1
-1
src/component/tooltip/TooltipView.ts
src/component/tooltip/TooltipView.ts
+2
-2
src/data/List.ts
src/data/List.ts
+1
-1
src/label/LabelManager.ts
src/label/LabelManager.ts
+1
-1
src/model/Series.ts
src/model/Series.ts
+7
-3
src/util/format.ts
src/util/format.ts
+1
-1
未找到文件。
src/chart/bar/BarView.ts
浏览文件 @
aee0b1a0
...
...
@@ -26,7 +26,7 @@ import {
initLabel
,
removeElementWithFadeOut
}
from
'
../../util/graphic
'
;
import
{
getECData
}
from
"
../../util/ecData
"
;
import
{
getECData
}
from
'
../../util/ecData
'
;
import
{
enableHoverEmphasis
,
setStatesStylesFromModel
}
from
'
../../util/states
'
;
import
{
setLabelStyle
,
getLabelStatesModels
}
from
'
../../label/labelStyle
'
;
import
Path
,
{
PathProps
}
from
'
zrender/src/graphic/Path
'
;
...
...
src/chart/map/MapSeries.ts
浏览文件 @
aee0b1a0
...
...
@@ -210,8 +210,7 @@ class MapSeries extends SeriesModel<MapSeriesOption> {
+
encodeHTML
(
name
)
+
'
:
'
+
formattedValue
;
}
return
`<span style="font-size:12px;color:#6e7079;">
${
seriesNames
.
join
(
'
,
'
)}
</span>`
+
(
seriesNames
.
length
?
'
<br />
'
:
''
)
return
`<div style="font-size:12px;color:#6e7079;">
${
seriesNames
.
join
(
'
,
'
)}
</div>`
+
concatTooltipHtml
(
name
,
formattedValue
);
}
...
...
src/chart/radar/RadarSeries.ts
浏览文件 @
aee0b1a0
...
...
@@ -138,11 +138,12 @@ class RadarSeriesModel extends SeriesModel<RadarSeriesOption> {
return
encodeHTML
(
axis
.
name
)
+
'
:
'
+
val
;
}).
join
(
'
\n
'
);
}
return
`<span style="font-size:12px;color:#6e7079;>
${
encodeHTML
(
name
===
''
?
this
.
name
:
name
)}
</span>`
+
'
<br/>
'
return
'
<div style="font-size:12px;color:#6e7079;line-height:1">
'
+
encodeHTML
(
name
===
''
?
this
.
name
:
name
)
+
'
</div>
'
+
zrUtil
.
map
(
indicatorAxes
,
function
(
axis
)
{
const
val
=
data
.
get
(
data
.
mapDimension
(
axis
.
dim
),
dataIndex
);
return
'
<div style="margin:
8px 0 0;
">
'
return
'
<div style="margin:
11px 0 0;line-height:1
">
'
+
concatTooltipHtml
(
axis
.
name
,
val
)
+
'
</div>
'
;
}).
join
(
''
);
...
...
src/chart/sankey/SankeySeries.ts
浏览文件 @
aee0b1a0
...
...
@@ -246,7 +246,9 @@ class SankeySeriesModel extends SeriesModel<SankeySeriesOption> {
if
(
renderMode
===
'
richText
'
)
{
return
encodeHTML
(
rawDataOpt
.
source
+
'
--
'
+
rawDataOpt
.
target
)
+
params
.
value
;
}
return
concatTooltipHtml
(
rawDataOpt
.
source
+
'
--
'
+
rawDataOpt
.
target
,
params
.
value
||
''
);
return
'
<div style="line-height:1">
'
+
concatTooltipHtml
(
rawDataOpt
.
source
+
'
--
'
+
rawDataOpt
.
target
,
params
.
value
||
''
)
+
'
</div>
'
;
}
else
if
(
dataType
===
'
node
'
)
{
const
node
=
this
.
getGraph
().
getNodeByIndex
(
dataIndex
);
...
...
@@ -255,7 +257,9 @@ class SankeySeriesModel extends SeriesModel<SankeySeriesOption> {
if
(
renderMode
===
'
richText
'
)
{
return
encodeHTML
(
value
?
name
:
''
)
+
'
:
'
+
(
value
||
''
);
}
return
concatTooltipHtml
(
value
?
name
:
''
,
value
||
''
);
return
'
<div style="line-height:1">
'
+
concatTooltipHtml
(
value
?
name
:
''
,
value
||
''
)
+
'
</div>
'
;
}
return
super
.
formatTooltip
(
dataIndex
,
multipleSeries
,
dataType
,
renderMode
);
}
...
...
src/chart/themeRiver/ThemeRiverSeries.ts
浏览文件 @
aee0b1a0
...
...
@@ -305,7 +305,7 @@ class ThemeRiverSeriesModel extends SeriesModel<ThemeRiverSeriesOption> {
if
(
renderMode
===
'
richText
'
)
{
return
encodeHTML
(
htmlName
)
+
'
:
'
+
htmlValue
;
}
return
'
<div style="margin:
8px 0 0;
">
'
return
'
<div style="margin:
11px 0 0;line-height:1
">
'
+
concatTooltipHtml
(
htmlName
,
htmlValue
)
+
'
</div>
'
;
}
...
...
src/chart/tree/TreeSeries.ts
浏览文件 @
aee0b1a0
...
...
@@ -224,7 +224,9 @@ class TreeSeriesModel extends SeriesModel<TreeSeriesOption> {
return
encodeHTML
(
name
)
+
'
:
'
+
((
isNaN
(
value
as
number
)
||
value
==
null
)
?
''
:
value
);
}
return
concatTooltipHtml
(
name
,
(
isNaN
(
value
as
number
)
||
value
==
null
)
?
''
:
value
);
return
'
<div style="line-height:1">
'
+
concatTooltipHtml
(
name
,
(
isNaN
(
value
as
number
)
||
value
==
null
)
?
''
:
value
)
+
'
</div>
'
;
}
static
defaultOption
:
TreeSeriesOption
=
{
...
...
src/chart/treemap/TreemapSeries.ts
浏览文件 @
aee0b1a0
...
...
@@ -395,7 +395,9 @@ class TreemapSeriesModel extends SeriesModel<TreemapSeriesOption> {
if
(
renderMode
===
'
richText
'
)
{
return
encodeHTML
(
name
)
+
'
:
'
+
formattedValue
;
}
return
concatTooltipHtml
(
name
,
formattedValue
);
return
'
<div style="line-height:1">
'
+
concatTooltipHtml
(
name
,
formattedValue
)
+
'
</div>
'
;
}
/**
...
...
src/component/geo/GeoView.ts
浏览文件 @
aee0b1a0
...
...
@@ -24,7 +24,7 @@ import GlobalModel from '../../model/Global';
import
ExtensionAPI
from
'
../../ExtensionAPI
'
;
import
GeoModel
from
'
../../coord/geo/GeoModel
'
;
import
{
Payload
,
ZRElementEvent
,
ECEventData
}
from
'
../../util/types
'
;
import
{
getECData
}
from
"
../../util/ecData
"
;
import
{
getECData
}
from
'
../../util/ecData
'
;
import
{
enterSelect
,
leaveSelect
}
from
'
../../util/states
'
;
class
GeoView
extends
ComponentView
{
...
...
src/component/marker/MarkPointView.ts
浏览文件 @
aee0b1a0
...
...
@@ -31,7 +31,7 @@ import GlobalModel from '../../model/Global';
import
MarkerModel
from
'
./MarkerModel
'
;
import
ExtensionAPI
from
'
../../ExtensionAPI
'
;
import
{
HashMap
,
isFunction
,
map
,
defaults
,
filter
,
curry
}
from
'
zrender/src/core/util
'
;
import
{
getECData
}
from
"
../../util/ecData
"
;
import
{
getECData
}
from
'
../../util/ecData
'
;
import
{
getVisualFromData
}
from
'
../../visual/helper
'
;
import
{
ZRColor
}
from
'
../../util/types
'
;
...
...
src/component/marker/MarkerModel.ts
浏览文件 @
aee0b1a0
...
...
@@ -209,16 +209,16 @@ abstract class MarkerModel<Opts extends MarkerOption = MarkerOption> extends Com
const
formattedValue
=
zrUtil
.
isArray
(
value
)
?
zrUtil
.
map
(
value
,
addCommas
).
join
(
'
,
'
)
:
addCommas
(
value
as
number
);
const
name
=
encodeHTML
(
data
.
getName
(
dataIndex
));
let
html
=
encodeHTML
(
this
.
name
)
;
let
html
=
`<div style="font-size:12px;line-height:1;margin:0 0 8px 0;">
${
encodeHTML
(
this
.
name
)}
</div>`
;
if
(
value
!=
null
||
name
)
{
html
+=
renderMode
===
'
html
'
?
'
<br />
'
:
'
\n
'
;
html
+=
renderMode
===
'
html
'
?
''
:
'
\n
'
;
}
if
(
name
)
{
html
+=
name
;
html
+=
`<div style="line-height:1"><span style="font-size:12px;color:#6e7079;">
${
name
}
</span>`
;
}
if
(
value
!=
null
)
{
html
=
renderMode
===
'
html
'
?
concatTooltipHtml
(
html
,
formattedValue
,
true
)
?
concatTooltipHtml
(
html
,
formattedValue
,
true
)
+
(
name
?
'
</div>
'
:
''
)
:
(
html
+
formattedValue
);
}
return
html
;
...
...
src/component/tooltip/TooltipModel.ts
浏览文件 @
aee0b1a0
...
...
@@ -129,7 +129,7 @@ class TooltipModel extends ComponentModel<TooltipOption> {
// Tooltip inside padding, default is 5 for all direction
// Array is allowed to set up, right, bottom, left, same with css
padding
:
[
4
,
10
,
10
],
padding
:
[
6
,
10
,
10
],
// Extra css text
extraCssText
:
''
,
...
...
src/component/tooltip/TooltipView.ts
浏览文件 @
aee0b1a0
...
...
@@ -626,8 +626,8 @@ class TooltipView extends ComponentView {
(
firstLine
?
(
'
<
span style="font-size:12px;color:#6e7079;
">
'
+
formatUtil
.
encodeHTML
(
firstLine
)
+
'
</
span
>
'
'
<
div style="font-size:12px;color:#6e7079;line-height:1
">
'
+
formatUtil
.
encodeHTML
(
firstLine
)
+
'
</
div
>
'
+
newLine
)
:
''
...
...
src/data/List.ts
浏览文件 @
aee0b1a0
...
...
@@ -38,7 +38,7 @@ import {
}
from
'
../util/types
'
;
import
{
parseDate
}
from
'
../util/number
'
;
import
{
isDataItemOption
}
from
'
../util/model
'
;
import
{
getECData
}
from
"
../util/ecData
"
;
import
{
getECData
}
from
'
../util/ecData
'
;
import
{
PathStyleProps
}
from
'
zrender/src/graphic/Path
'
;
import
type
Graph
from
'
./Graph
'
;
import
type
Tree
from
'
./Tree
'
;
...
...
src/label/LabelManager.ts
浏览文件 @
aee0b1a0
...
...
@@ -26,7 +26,7 @@ import {
updateProps
,
initProps
}
from
'
../util/graphic
'
;
import
{
getECData
}
from
"
../util/ecData
"
;
import
{
getECData
}
from
'
../util/ecData
'
;
import
ExtensionAPI
from
'
../ExtensionAPI
'
;
import
{
ZRTextAlign
,
...
...
src/model/Series.ts
浏览文件 @
aee0b1a0
...
...
@@ -553,15 +553,19 @@ class SeriesModel<Opt extends SeriesOption = SeriesOption> extends ComponentMode
colorStr
=
zrUtil
.
isString
(
colorEl
)
?
colorEl
:
colorEl
.
content
;
let
html
=
''
;
if
(
!
isRichText
)
{
seriesName
=
seriesName
?
`<span style="font-size:12px;color:#6e7079;">
${
seriesName
}
</span>`
:
''
;
seriesName
=
seriesName
?
!
multipleSeries
?
`<div style="font-size:12px;color:#6e7079;line-height:1">
${
seriesName
}
</div>`
:
`<span style="font-size:12px;color:#6e7079;line-height:1">
${
seriesName
}
</span>`
:
''
;
html
=
!
multipleSeries
?
seriesName
+
(
seriesName
?
'
<br/>
'
:
''
)
+
`<div style="margin:
${
seriesName
?
8
:
0
}
px 0 0;
">`
?
seriesName
+
`<div style="margin:
${
seriesName
?
8
:
0
}
px 0 0;line-height:1
">`
+
colorStr
+
(
name
?
`<span style="font-size:12px;color:#6e7079;">
${
encodeHTML
(
name
)}
</span>
${
content
}
`
:
content
)
+
'
</div>
'
:
`<div style="margin:
8px 0 0
;">
${
colorStr
}${
seriesName
}${
content
}
</div>`
;
:
`<div style="margin:
11px 0 0;line-height:1
;">
${
colorStr
}${
seriesName
}${
content
}
</div>`
;
}
else
{
html
=
!
multipleSeries
...
...
src/util/format.ts
浏览文件 @
aee0b1a0
...
...
@@ -68,7 +68,7 @@ export function encodeHTML(source: string): string {
export
function
concatTooltipHtml
(
html
:
string
,
value
:
unknown
,
dontEncodeHtml
?:
boolean
):
string
{
return
(
dontEncodeHtml
?
html
:
`<span style="font-size:12px;color:#6e7079;">
${
encodeHTML
(
html
)}
</span>`
)
+
(
value
?
'
<span style="float:right;margin-left:20px;color:#464646;font-weight:900;font-size:14px
";
>
'
:
''
)
+
(
value
?
'
<span style="float:right;margin-left:20px;color:#464646;font-weight:900;font-size:14px
;"
>
'
:
''
)
+
encodeHTML
(
value
as
string
)
+
(
value
?
'
</span>
'
:
''
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录