Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
561408af
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,发现更多精彩内容 >>
提交
561408af
编写于
3月 14, 2018
作者:
D
deqingli
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master' into sankey
上级
ebf21655
c2057625
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
242 addition
and
13 deletion
+242
-13
.gitignore
.gitignore
+1
-0
README.md
README.md
+1
-0
src/chart/helper/SymbolDraw.js
src/chart/helper/SymbolDraw.js
+4
-2
src/chart/line/LineView.js
src/chart/line/LineView.js
+13
-4
src/component/marker/MarkAreaView.js
src/component/marker/MarkAreaView.js
+3
-3
src/component/marker/MarkLineView.js
src/component/marker/MarkLineView.js
+3
-3
src/component/marker/MarkerModel.js
src/component/marker/MarkerModel.js
+1
-1
src/component/marker/markerHelper.js
src/component/marker/markerHelper.js
+4
-0
src/data/List.js
src/data/List.js
+23
-0
test/dataZoom-clip.html
test/dataZoom-clip.html
+62
-0
test/scatter-markline.html
test/scatter-markline.html
+127
-0
未找到文件。
.gitignore
浏览文件 @
561408af
...
...
@@ -161,6 +161,7 @@ pip-log.txt
# Mac crap
.DS_Store
.idea
node_modules
...
...
README.md
浏览文件 @
561408af
...
...
@@ -82,6 +82,7 @@ ECharts-GL is an extension pack of ECharts, which provides 3D plots, globe visua
#### Ember Binding
+
[
echarts-ember
](
https://github.com/bruckwubete/echarts-ember
)
by
[
bruck wubete
](
https://github.com/bruckwubete
)
+
[
ember-cli-echarts
](
https://github.com/funnelcloudinc/ember-cli-echarts
)
by FunnelCloud
#### Vue Component
...
...
src/chart/helper/SymbolDraw.js
浏览文件 @
561408af
...
...
@@ -22,11 +22,13 @@ var symbolDrawProto = SymbolDraw.prototype;
function
symbolNeedsDraw
(
data
,
point
,
idx
,
opt
)
{
return
point
&&
!
isNaN
(
point
[
0
])
&&
!
isNaN
(
point
[
1
])
&&
!
(
opt
.
isIgnore
&&
opt
.
isIgnore
(
idx
))
// We do not set clipShape on group, because it will
// cut part of the symbol element shape.
// We do not set clipShape on group, because it will cut part of
// the symbol element shape. We use the same clip shape here as
// the line clip.
&&
!
(
opt
.
clipShape
&&
!
opt
.
clipShape
.
contain
(
point
[
0
],
point
[
1
]))
&&
data
.
getItemVisual
(
idx
,
'
symbol
'
)
!==
'
none
'
;
}
/**
* Update symbols draw by new data
* @param {module:echarts/data/List} data
...
...
src/chart/line/LineView.js
浏览文件 @
561408af
...
...
@@ -9,6 +9,7 @@ import * as graphic from '../../util/graphic';
import
*
as
modelUtil
from
'
../../util/model
'
;
import
{
Polyline
,
Polygon
}
from
'
./poly
'
;
import
ChartView
from
'
../../view/Chart
'
;
import
{
round
}
from
'
../../util/number
'
;
import
{
prepareDataCoordInfo
,
getStackedOnPoint
}
from
'
./helper
'
;
function
isPointsSame
(
points1
,
points2
)
{
...
...
@@ -81,6 +82,14 @@ function createGridClipShape(cartesian, hasAnimation, seriesModel) {
width
+=
expandSize
*
2
;
}
// Avoid numberic rounding error (when the point is on the edge,
// the result may be unexpectedly by rounding error).
// See #7913 and `test/dataZoom-clip.html`.
x
=
round
(
x
,
1
);
y
=
round
(
y
,
1
);
width
=
round
(
width
,
1
);
height
=
round
(
height
,
1
);
var
clipPath
=
new
graphic
.
Rect
({
shape
:
{
x
:
x
,
...
...
@@ -114,10 +123,10 @@ function createPolarClipShape(polar, hasAnimation, seriesModel) {
var
clipPath
=
new
graphic
.
Sector
({
shape
:
{
cx
:
polar
.
cx
,
cy
:
polar
.
cy
,
r0
:
r
adiusExtent
[
0
]
,
r
:
r
adiusExtent
[
1
]
,
cx
:
round
(
polar
.
cx
,
1
)
,
cy
:
round
(
polar
.
cy
,
1
)
,
r0
:
r
ound
(
radiusExtent
[
0
],
1
)
,
r
:
r
ound
(
radiusExtent
[
1
],
1
)
,
startAngle
:
-
angleExtent
[
0
]
*
RADIAN
,
endAngle
:
-
angleExtent
[
1
]
*
RADIAN
,
clockwise
:
angleAxis
.
inverse
...
...
src/component/marker/MarkAreaView.js
浏览文件 @
561408af
...
...
@@ -171,12 +171,12 @@ MarkerView.extend({
renderSeries
:
function
(
seriesModel
,
maModel
,
ecModel
,
api
)
{
var
coordSys
=
seriesModel
.
coordinateSystem
;
var
series
Name
=
seriesModel
.
name
;
var
series
Id
=
seriesModel
.
id
;
var
seriesData
=
seriesModel
.
getData
();
var
areaGroupMap
=
this
.
markerGroupMap
;
var
polygonGroup
=
areaGroupMap
.
get
(
series
Name
)
||
areaGroupMap
.
set
(
series
Name
,
{
group
:
new
graphic
.
Group
()});
var
polygonGroup
=
areaGroupMap
.
get
(
series
Id
)
||
areaGroupMap
.
set
(
series
Id
,
{
group
:
new
graphic
.
Group
()});
this
.
group
.
add
(
polygonGroup
.
group
);
polygonGroup
.
__keep
=
true
;
...
...
src/component/marker/MarkLineView.js
浏览文件 @
561408af
...
...
@@ -7,12 +7,12 @@ import MarkerView from './MarkerView';
var
markLineTransform
=
function
(
seriesModel
,
coordSys
,
mlModel
,
item
)
{
var
data
=
seriesModel
.
getData
();
// Special type markLine like 'min', 'max', 'average'
// Special type markLine like 'min', 'max', 'average'
, 'median'
var
mlType
=
item
.
type
;
if
(
!
zrUtil
.
isArray
(
item
)
&&
(
mlType
===
'
min
'
||
mlType
===
'
max
'
||
mlType
===
'
average
'
mlType
===
'
min
'
||
mlType
===
'
max
'
||
mlType
===
'
average
'
||
mlType
===
'
median
'
// In case
// data: [{
// yAxis: 10
...
...
@@ -373,4 +373,4 @@ function createList(coordSys, seriesModel, mlModel) {
to
:
toData
,
line
:
lineData
};
}
\ No newline at end of file
}
src/component/marker/MarkerModel.js
浏览文件 @
561408af
...
...
@@ -50,7 +50,7 @@ var MarkerModel = echarts.extendComponentModel({
if
(
!
createdBySelf
)
{
ecModel
.
eachSeries
(
function
(
seriesModel
)
{
var
markerOpt
=
seriesModel
.
get
(
this
.
mainType
);
var
markerOpt
=
seriesModel
.
get
(
this
.
mainType
,
true
);
var
markerModel
=
seriesModel
[
modelPropName
];
if
(
!
markerOpt
||
!
markerOpt
.
data
)
{
...
...
src/component/marker/markerHelper.js
浏览文件 @
561408af
...
...
@@ -212,7 +212,11 @@ export function numCalculate(data, valueDataDim, type) {
});
return
sum
/
count
;
}
else
if
(
type
===
'
median
'
)
{
return
data
.
getMedian
(
valueDataDim
);
}
else
{
// max & min
return
data
.
getDataExtent
(
valueDataDim
,
true
)[
type
===
'
max
'
?
1
:
0
];
}
}
src/data/List.js
浏览文件 @
561408af
...
...
@@ -861,6 +861,29 @@ listProto.getSum = function (dim /*, stack */) {
return
sum
;
};
/**
* Get median of data in one dimension
* @param {string} dim
*/
listProto
.
getMedian
=
function
(
dim
/*, stack */
)
{
var
dimDataArray
=
[];
// map all data of one dimension
this
.
each
(
dim
,
function
(
val
,
idx
)
{
if
(
!
isNaN
(
val
))
{
dimDataArray
.
push
(
val
);
}
});
// immutability & sort
var
sortedDimDataArray
=
[].
concat
(
dimDataArray
).
sort
(
function
(
a
,
b
)
{
return
a
-
b
;
});
var
len
=
this
.
count
();
// calculate median
return
len
===
0
?
0
:
len
%
2
===
1
?
sortedDimDataArray
[(
len
-
1
)
/
2
]
:
(
sortedDimDataArray
[
len
/
2
]
+
sortedDimDataArray
[
len
/
2
-
1
])
/
2
;
};
// /**
// * Retreive the index with given value
// * @param {string} dim Concrete dimension.
...
...
test/dataZoom-clip.html
浏览文件 @
561408af
...
...
@@ -18,6 +18,7 @@
</style>
<div
id=
"main0"
></div>
<div
id=
"main1"
></div>
...
...
@@ -94,5 +95,66 @@
</script>
<script>
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
},
xAxis
:
{
type
:
'
category
'
,
boundaryGap
:
false
,
data
:
[
'
first
'
,
'
middle
'
,
'
last
'
]
},
yAxis
:
{
type
:
'
value
'
},
series
:
[
{
name
:
'
邮件营销
'
,
type
:
'
line
'
,
stack
:
'
总量
'
,
symbolSize
:
20
,
data
:[
120
,
132
,
101
]
},
// {
// name:'联盟广告',
// type:'line',
// stack: '总量',
// symbolSize: 20,
// data:[220, 182, 191]
// }
]
};
chart
=
myChart
=
testHelper
.
create
(
echarts
,
'
main1
'
,
{
title
:
'
The first and last symbols (on the edge) should be displayed.
'
,
option
:
option
});
</script>
</body>
</html>
\ No newline at end of file
test/scatter-markline.html
0 → 100644
浏览文件 @
561408af
<html>
<head>
<meta
charset=
"utf-8"
>
<script
src=
"lib/esl.js"
></script>
<script
src=
"lib/config.js"
></script>
</head>
<body>
<style>
html
,
body
,
#main
{
width
:
100%
;
height
:
100%
;
}
</style>
<div
id=
"main"
></div>
<script>
require
([
'
echarts
'
// 'echarts/chart/scatter',
// 'echarts/component/legend',
// 'echarts/component/grid',
// 'echarts/component/tooltip',
// 'echarts/component/toolbox'
],
function
(
echarts
)
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
));
var
data1
=
[];
var
names
=
[
'
diamond, red, show inside label only on hover
'
,
];
var
random
=
function
(
max
)
{
return
(
Math
.
random
()
*
max
).
toFixed
(
3
);
}
for
(
var
i
=
0
;
i
<
50
;
i
++
)
{
data1
.
push
([
random
(
5
),
random
(
5
),
random
(
2
)]);
}
chart
.
setOption
({
aria
:
{
show
:
true
},
legend
:
{
data
:
names
.
slice
()
},
toolbox
:
{
left
:
'
left
'
,
feature
:
{
dataView
:
{},
saveAsImage
:
{},
dataZoom
:
{}
}
},
tooltip
:
{
trigger
:
'
axis
'
,
axisPointer
:
{
type
:
'
cross
'
}
},
xAxis
:
{
type
:
'
value
'
,
splitLine
:
{
show
:
false
},
min
:
0
,
max
:
15
,
splitNumber
:
30
},
yAxis
:
{
type
:
'
value
'
,
splitLine
:
{
show
:
false
}
},
series
:
[{
name
:
names
[
0
],
type
:
'
scatter
'
,
label
:
{
emphasis
:
{
show
:
true
}
},
symbol
:
'
diamond
'
,
symbolSize
:
function
(
val
)
{
return
val
[
2
]
*
40
;
},
data
:
data1
,
markLine
:
{
data
:
[
{
name
:
'
平均线
'
,
type
:
'
average
'
},
{
name
:
'
最大值
'
,
type
:
'
max
'
},
{
name
:
'
最小值
'
,
type
:
'
min
'
},
{
name
:
'
中位数
'
,
type
:
'
median
'
}
]
}
}],
animationDelay
:
function
(
idx
)
{
return
idx
*
20
;
},
animationDelayUpdate
:
function
(
idx
)
{
return
idx
*
20
;
}
});
chart
.
on
(
'
click
'
,
function
(
params
)
{
console
.
log
(
params
.
data
);
});
})
</script>
</body>
</html>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录