Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
b90f6ec4
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
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,发现更多精彩内容 >>
提交
b90f6ec4
编写于
4月 07, 2021
作者:
P
plainheart
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/apache/echarts
into fix-linear-gradient
上级
7940f5ae
1320c287
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
115 addition
and
5 deletion
+115
-5
src/chart/effectScatter/EffectScatterSeries.ts
src/chart/effectScatter/EffectScatterSeries.ts
+2
-0
src/chart/effectScatter/EffectScatterView.ts
src/chart/effectScatter/EffectScatterView.ts
+7
-1
src/chart/gauge/GaugeView.ts
src/chart/gauge/GaugeView.ts
+22
-2
src/chart/helper/Line.ts
src/chart/helper/Line.ts
+1
-1
src/chart/line/LineView.ts
src/chart/line/LineView.ts
+1
-1
test/gauge-pointer.html
test/gauge-pointer.html
+82
-0
未找到文件。
src/chart/effectScatter/EffectScatterSeries.ts
浏览文件 @
b90f6ec4
...
...
@@ -71,6 +71,7 @@ export interface EffectScatterSeriesOption extends SeriesOption<EffectScatterSta
* When to show the effect
*/
showEffectOn
?:
'
render
'
|
'
emphasis
'
clip
?:
boolean
/**
* Ripple effect config
...
...
@@ -107,6 +108,7 @@ class EffectScatterSeriesModel extends SeriesModel<EffectScatterSeriesOption> {
// When to show the effect, option: 'render'|'emphasis'
showEffectOn
:
'
render
'
,
clip
:
true
,
// Ripple effect config
rippleEffect
:
{
...
...
src/chart/effectScatter/EffectScatterView.ts
浏览文件 @
b90f6ec4
...
...
@@ -41,10 +41,16 @@ class EffectScatterView extends ChartView {
render
(
seriesModel
:
EffectScatterSeriesModel
,
ecModel
:
GlobalModel
,
api
:
ExtensionAPI
)
{
const
data
=
seriesModel
.
getData
();
const
effectSymbolDraw
=
this
.
_symbolDraw
;
effectSymbolDraw
.
updateData
(
data
);
effectSymbolDraw
.
updateData
(
data
,
{
clipShape
:
this
.
_getClipShape
(
seriesModel
)}
);
this
.
group
.
add
(
effectSymbolDraw
.
group
);
}
_getClipShape
(
seriesModel
:
EffectScatterSeriesModel
)
{
const
coordSys
=
seriesModel
.
coordinateSystem
;
const
clipArea
=
coordSys
&&
coordSys
.
getArea
&&
coordSys
.
getArea
();
return
seriesModel
.
get
(
'
clip
'
,
true
)
?
clipArea
:
null
;
}
updateTransform
(
seriesModel
:
EffectScatterSeriesModel
,
ecModel
:
GlobalModel
,
api
:
ExtensionAPI
)
{
const
data
=
seriesModel
.
getData
();
...
...
src/chart/gauge/GaugeView.ts
浏览文件 @
b90f6ec4
...
...
@@ -30,6 +30,10 @@ import { ColorString, ECElement } from '../../util/types';
import
List
from
'
../../data/List
'
;
import
Sausage
from
'
../../util/shape/sausage
'
;
import
{
createSymbol
}
from
'
../../util/symbol
'
;
import
ZRImage
from
'
zrender/src/graphic/Image
'
;
import
{
extend
}
from
'
zrender/src/core/util
'
;
type
ECSymbol
=
ReturnType
<
typeof
createSymbol
>
;
interface
PosInfo
{
cx
:
number
...
...
@@ -476,9 +480,25 @@ class GaugeView extends ChartView {
const
itemModel
=
data
.
getItemModel
<
GaugeDataItemOption
>
(
idx
);
const
emphasisModel
=
itemModel
.
getModel
(
'
emphasis
'
);
if
(
showPointer
)
{
const
pointer
=
data
.
getItemGraphicEl
(
idx
)
as
PointerPath
;
pointer
.
useStyle
(
data
.
getItemVisual
(
idx
,
'
style
'
));
const
pointer
=
data
.
getItemGraphicEl
(
idx
)
as
ECSymbol
;
const
symbolStyle
=
data
.
getItemVisual
(
idx
,
'
style
'
);
const
visualColor
=
symbolStyle
.
fill
;
if
(
pointer
instanceof
ZRImage
)
{
const
pathStyle
=
pointer
.
style
;
pointer
.
useStyle
(
extend
({
image
:
pathStyle
.
image
,
x
:
pathStyle
.
x
,
y
:
pathStyle
.
y
,
width
:
pathStyle
.
width
,
height
:
pathStyle
.
height
},
symbolStyle
));
}
else
{
pointer
.
useStyle
(
symbolStyle
);
pointer
.
type
!==
'
pointer
'
&&
pointer
.
setColor
(
visualColor
);
}
pointer
.
setStyle
(
itemModel
.
getModel
([
'
pointer
'
,
'
itemStyle
'
]).
getItemStyle
());
if
(
pointer
.
style
.
fill
===
'
auto
'
)
{
pointer
.
setStyle
(
'
fill
'
,
getColor
(
linearMap
(
data
.
get
(
valueDim
,
idx
)
as
number
,
valueExtent
,
[
0
,
1
],
true
)
...
...
src/chart/helper/Line.ts
浏览文件 @
b90f6ec4
...
...
@@ -70,7 +70,7 @@ function createSymbol(name: 'fromSymbol' | 'toSymbol', lineData: LineList, idx:
const
symbolSize
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Size
'
as
'
fromSymbolSize
'
|
'
toSymbolSize
'
);
const
symbolRotate
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Rotate
'
as
'
fromSymbolRotate
'
|
'
toSymbolRotate
'
);
const
symbolOffset
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Offset
'
as
'
fromSymbolOffset
'
|
'
toSymbolOffset
'
);
const
symbolOffset
=
lineData
.
getItemVisual
(
idx
,
name
+
'
Offset
'
as
'
fromSymbolOffset
'
|
'
toSymbolOffset
'
)
||
0
;
const
symbolKeepAspect
=
lineData
.
getItemVisual
(
idx
,
name
+
'
KeepAspect
'
as
'
fromSymbolKeepAspect
'
|
'
toSymbolKeepAspect
'
);
...
...
src/chart/line/LineView.ts
浏览文件 @
b90f6ec4
...
...
@@ -738,7 +738,7 @@ class LineView extends ChartView {
if
(
polyline
.
style
.
lineWidth
>
0
&&
seriesModel
.
get
([
'
emphasis
'
,
'
lineStyle
'
,
'
width
'
])
===
'
bolder
'
)
{
const
emphasisLineStyle
=
polyline
.
getState
(
'
emphasis
'
).
style
;
emphasisLineStyle
.
lineWidth
=
polyline
.
style
.
lineWidth
+
1
;
emphasisLineStyle
.
lineWidth
=
+
polyline
.
style
.
lineWidth
+
1
;
}
// Needs seriesIndex for focus
...
...
test/gauge-pointer.html
浏览文件 @
b90f6ec4
...
...
@@ -45,6 +45,8 @@ under the License.
<div
id=
"main5"
></div>
<div
id=
"main6"
></div>
<div
id=
"main7"
></div>
<div
id=
"main8"
></div>
<div
id=
"main9"
></div>
...
...
@@ -547,6 +549,86 @@ under the License.
date
=
null
;
},
1000
);
var
option8
=
{
tooltip
:
{
formatter
:
'
{a} <br/>{b} : {c}%
'
},
toolbox
:
{
feature
:
{
restore
:
{},
saveAsImage
:
{}
}
},
series
:
[
{
name
:
'
业务指标
'
,
type
:
'
gauge
'
,
anchor
:
{
show
:
true
,
icon
:
"
image://https://www.apache.org/img/support-apache.jpg
"
,
size
:
50
,
showAbove
:
true
},
pointer
:
{
icon
:
"
image://https://www.apache.org/img/support-apache.jpg
"
,
length
:
"
70%
"
},
detail
:
{
formatter
:
'
{value}%
'
},
data
:
[{
value
:
58.46
,
name
:
'
完成率
'
}]
}
]
};
var
chart8
=
testHelper
.
create
(
echarts
,
'
main8
'
,
{
title
:
[
'
pointer.icon: "image://url"
'
,
'
anchor.icon: "image://url"
'
],
option
:
option8
// height: 1200,
// buttons: [{text: 'btn-txt', onclick: function () {}}],
// recordCanvas: true,
});
var
option9
=
{
tooltip
:
{
formatter
:
'
{a} <br/>{b} : {c}%
'
},
toolbox
:
{
feature
:
{
restore
:
{},
saveAsImage
:
{}
}
},
series
:
[
{
name
:
'
业务指标
'
,
type
:
'
gauge
'
,
pointer
:
{
icon
:
'
emptyCircle
'
,
itemStyle
:
{
borderWidth
:
10
,
borderColor
:
'
#f00
'
},
},
anchor
:
{
// show: true
},
detail
:
{
formatter
:
'
{value}%
'
},
data
:
[{
value
:
58.46
,
name
:
'
完成率
'
}]
}
]
};
var
chart9
=
testHelper
.
create
(
echarts
,
'
main9
'
,
{
title
:
[
'
pointer.icon: emptyCircle
'
,
'
anchor.show: false
'
],
option
:
option9
});
});
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录