Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
9f7d5e73
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,发现更多精彩内容 >>
提交
9f7d5e73
编写于
7月 26, 2013
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mapValueCalculation dataRange bug fixed
上级
bb30cb4d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
80 addition
and
19 deletion
+80
-19
doc/changelog.html
doc/changelog.html
+10
-5
doc/doc.html
doc/doc.html
+6
-0
src/chart/map.js
src/chart/map.js
+17
-0
src/component/dataRange.js
src/component/dataRange.js
+45
-13
src/config.js
src/config.js
+2
-1
未找到文件。
doc/changelog.html
浏览文件 @
9f7d5e73
...
...
@@ -61,15 +61,20 @@
<div
class=
"container"
>
<h2>
修改记录
</h2>
<span>
[+]新增 [-]删除 [^]升级 [#]修复 【】重要
</span>
<div
class=
"row-fluid"
>
<div>
<h3>
undergoing
</h3>
<ul>
<li>
[upgraded][折线图] 主线支持shadow,item描边与主线相等
</li>
<li>
[upgraded] Retina视网屏优化
</li>
<li>
[bug fixed][地图] 福建省hover
</li>
<li>
[bug fixed][tooltip] 修正边界自动折行
</li>
<li>
[bug fixed][island] 修正拖拽empty item生成白色孤岛数据
</li>
<li>
[+] [compoent] 新增Title组件,图表标题支持
</li>
<li>
[^] [line] 折线图主线支持阴影(IE8-不支持),调整symbo描边与主线等宽
</li>
<li>
[^] [valueAxis] 支持数值坐标轴上显示项目文字
</li>
<li>
[^] [map] 数值计算方式支持均值和求和
</li>
<li>
[^] Retina视网屏优化
</li>
<li>
[#] [map] 修正福建省hover
</li>
<li>
[#] [tooltip] 修正气泡边界自动折行
</li>
<li>
[#] [island] 修正拖拽折线图的empty symbo生成白色孤岛数据
</li>
<li>
[#] [dataRange] 修正小数状态下的取整显示
</li>
</ul>
</div>
<div>
...
...
doc/doc.html
浏览文件 @
9f7d5e73
...
...
@@ -1559,6 +1559,12 @@ feature : {
<td>
地图
</td>
<td>
地图位置设置,默认只适应上下左右居中可配x,y,width,height,任意参数为空都将根据其他参数自适应
</td>
</tr>
<tr>
<td>
{string} mapValueCalculation
</td>
<td>
'sum'
</td>
<td>
地图
</td>
<td>
地图数值计算方式,默认为加和,可选为:'sum'(总数) | 'mean'(均值)
</td>
</tr>
<tr>
<td>
{Array} data
</td>
<td>
[]
</td>
...
...
src/chart/map.js
浏览文件 @
9f7d5e73
...
...
@@ -37,6 +37,7 @@ define(function(require) {
var
_scale
;
var
_position
;
var
_selectedMode
;
var
_valueCalculation
;
var
_selected
=
{};
function
_buildShape
()
{
...
...
@@ -50,12 +51,15 @@ define(function(require) {
var
name
;
_mapSeries
=
{};
_selectedMode
=
false
;
_valueCalculation
=
null
;
for
(
var
i
=
0
,
l
=
series
.
length
;
i
<
l
;
i
++
)
{
if
(
series
[
i
].
type
==
ecConfig
.
CHART_TYPE_MAP
)
{
series
[
i
]
=
self
.
reformOption
(
series
[
i
]);
_mapSeries
[
i
]
=
true
;
_selectedMode
=
_selectedMode
||
series
[
i
].
selectedMode
;
_valueCalculation
=
_valueCalculation
||
series
[
i
].
mapValueCalculation
;
mapType
=
series
[
i
].
mapType
;
seriesName
=
series
[
i
].
name
;
...
...
@@ -86,6 +90,19 @@ define(function(require) {
}
}
if
(
_valueCalculation
&&
_valueCalculation
==
'
mean
'
)
{
for
(
var
k
in
valueData
)
{
valueData
[
k
].
value
=
valueData
[
k
].
value
/
valueData
[
k
].
seriesIndex
.
length
;
if
(
valueData
[
k
].
value
>
10
)
{
valueData
[
k
].
value
=
Math
.
round
(
valueData
[
k
].
value
);
}
else
{
valueData
[
k
].
value
=
valueData
[
k
].
value
.
toFixed
(
2
)
-
0
;
}
}
}
switch
(
mapType
)
{
case
'
china
'
:
_buildMap
(
_getMapDataOfChina
(),
valueData
);
...
...
src/component/dataRange.js
浏览文件 @
9f7d5e73
...
...
@@ -314,8 +314,21 @@ define(function (require) {
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
textHieght
=
zrArea
.
getTextWidth
(
'
国
'
,
font
)
+
2
;
var
textWidth
=
Math
.
max
(
zrArea
.
getTextWidth
(
dataRangeOption
.
max
,
font
),
zrArea
.
getTextWidth
(
dataRangeOption
.
min
,
font
)
zrArea
.
getTextWidth
(
dataRangeOption
.
precision
===
0
?
dataRangeOption
.
max
:
dataRangeOption
.
max
.
toFixed
(
dataRangeOption
.
precision
),
font
),
zrArea
.
getTextWidth
(
dataRangeOption
.
precision
===
0
?
dataRangeOption
.
min
:
dataRangeOption
.
min
.
toFixed
(
dataRangeOption
.
precision
),
font
)
)
+
2
;
var
pointListStart
;
...
...
@@ -966,23 +979,38 @@ define(function (require) {
_startShape
.
style
.
x
-
_startShape
.
style
.
_x
,
_startShape
.
style
.
y
-
_startShape
.
style
.
_y
];
_startShape
.
style
.
text
=
Math
.
round
(
_gap
*
_range
.
start
+
dataRangeOption
.
min
)
+
''
;
if
(
dataRangeOption
.
precision
===
0
)
{
_startShape
.
style
.
text
=
Math
.
round
(
_gap
*
_range
.
start
+
dataRangeOption
.
min
)
+
''
;
}
else
{
_startShape
.
style
.
text
=
(
_gap
*
_range
.
start
+
dataRangeOption
.
min
).
toFixed
(
dataRangeOption
.
precision
);
}
_startShape
.
style
.
color
=
getColor
(
Math
.
floor
(
_gap
*
_range
.
start
+
dataRangeOption
.
min
)
_gap
*
_range
.
start
+
dataRangeOption
.
min
);
zr
.
modShape
(
_startShape
.
id
,
_startShape
);
_endShape
.
position
=
[
_endShape
.
style
.
x
-
_endShape
.
style
.
_x
,
_endShape
.
style
.
y
-
_endShape
.
style
.
_y
];
_endShape
.
style
.
text
=
Math
.
round
(
_gap
*
_range
.
end
+
dataRangeOption
.
min
)
+
''
;
if
(
dataRangeOption
.
precision
===
0
)
{
_endShape
.
style
.
text
=
Math
.
round
(
_gap
*
_range
.
end
+
dataRangeOption
.
min
)
+
''
;
}
else
{
_endShape
.
style
.
text
=
(
_gap
*
_range
.
end
+
dataRangeOption
.
min
).
toFixed
(
dataRangeOption
.
precision
);
}
_endShape
.
style
.
color
=
getColor
(
Math
.
ceil
(
_gap
*
_range
.
end
+
dataRangeOption
.
min
)
_gap
*
_range
.
end
+
dataRangeOption
.
min
);
zr
.
modShape
(
_endShape
.
id
,
_endShape
);
...
...
@@ -1054,12 +1082,16 @@ define(function (require) {
}
_valueTextList
=
[];
for
(
var
i
=
0
;
i
<
splitNumber
;
i
++
){
for
(
var
i
=
0
;
i
<
splitNumber
;
i
++
)
{
_selectedMap
[
i
]
=
true
;
_valueTextList
.
unshift
(
(
i
*
_gap
+
dataRangeOption
.
min
)
(
i
*
_gap
+
dataRangeOption
.
min
).
toFixed
(
dataRangeOption
.
precision
)
+
'
-
'
+
((
i
+
1
)
*
_gap
+
dataRangeOption
.
min
)
+
((
i
+
1
)
*
_gap
+
dataRangeOption
.
min
).
toFixed
(
dataRangeOption
.
precision
)
);
}
...
...
src/config.js
浏览文件 @
9f7d5e73
...
...
@@ -422,7 +422,8 @@ define(function() {
// width // 自适应
// height // 自适应
},
// selectedMode: false, // 选择模式,默认关闭,可选single,multiple
// mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为:'sum' | 'mean'
// selectedMode: false, // 选择模式,默认关闭,可选single,multiple
itemStyle
:
{
normal
:
{
// color: 各异,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录