Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
feafbb9e
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,发现更多精彩内容 >>
提交
feafbb9e
编写于
6月 18, 2013
作者:
K
kener
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jshint~
上级
17c739b7
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
100 addition
and
118 deletion
+100
-118
src/chart/k.js
src/chart/k.js
+1
-6
src/chart/map.js
src/chart/map.js
+3
-6
src/chart/scatter.js
src/chart/scatter.js
+3
-5
src/component/dataRange.js
src/component/dataRange.js
+14
-19
src/component/legend.js
src/component/legend.js
+1
-1
src/component/tooltip.js
src/component/tooltip.js
+1
-1
src/component/valueAxis.js
src/component/valueAxis.js
+1
-1
src/config.js
src/config.js
+2
-2
src/util/mapData/china.js
src/util/mapData/china.js
+70
-70
src/util/shape/symbol.js
src/util/shape/symbol.js
+4
-7
未找到文件。
src/chart/k.js
浏览文件 @
feafbb9e
...
@@ -25,8 +25,6 @@ define(function(require) {
...
@@ -25,8 +25,6 @@ define(function(require) {
var
ecConfig
=
require
(
'
../config
'
);
var
ecConfig
=
require
(
'
../config
'
);
var
ecData
=
require
(
'
../util/ecData
'
);
var
ecData
=
require
(
'
../util/ecData
'
);
var
zrColor
=
require
(
'
zrender/tool/color
'
);
var
self
=
this
;
var
self
=
this
;
self
.
type
=
ecConfig
.
CHART_TYPE_K
;
self
.
type
=
ecConfig
.
CHART_TYPE_K
;
...
@@ -42,14 +40,11 @@ define(function(require) {
...
@@ -42,14 +40,11 @@ define(function(require) {
top
:
[],
top
:
[],
bottom
:
[]
bottom
:
[]
};
};
var
xAxisIndex
;
var
yAxisIndex
;
var
xAxis
;
var
xAxis
;
for
(
var
i
=
0
,
l
=
series
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
series
.
length
;
i
<
l
;
i
++
)
{
if
(
series
[
i
].
type
==
ecConfig
.
CHART_TYPE_K
)
{
if
(
series
[
i
].
type
==
ecConfig
.
CHART_TYPE_K
)
{
series
[
i
]
=
self
.
reformOption
(
series
[
i
]);
series
[
i
]
=
self
.
reformOption
(
series
[
i
]);
xAxisIndex
=
series
[
i
].
xAxisIndex
;
xAxis
=
component
.
xAxis
.
getAxis
(
series
[
i
].
xAxisIndex
);
xAxis
=
component
.
xAxis
.
getAxis
(
xAxisIndex
);
if
(
xAxis
.
type
==
ecConfig
.
COMPONENT_TYPE_AXIS_CATEGORY
if
(
xAxis
.
type
==
ecConfig
.
COMPONENT_TYPE_AXIS_CATEGORY
)
{
)
{
_position2sIndexMap
[
xAxis
.
getPosition
()].
push
(
i
);
_position2sIndexMap
[
xAxis
.
getPosition
()].
push
(
i
);
...
...
src/chart/map.js
浏览文件 @
feafbb9e
...
@@ -25,7 +25,6 @@ define(function(require) {
...
@@ -25,7 +25,6 @@ define(function(require) {
var
ecConfig
=
require
(
'
../config
'
);
var
ecConfig
=
require
(
'
../config
'
);
var
ecData
=
require
(
'
../util/ecData
'
);
var
ecData
=
require
(
'
../util/ecData
'
);
var
zrMath
=
require
(
'
zrender/tool/math
'
);
var
zrUtil
=
require
(
'
zrender/tool/util
'
);
var
zrUtil
=
require
(
'
zrender/tool/util
'
);
var
self
=
this
;
var
self
=
this
;
...
@@ -75,10 +74,8 @@ define(function(require) {
...
@@ -75,10 +74,8 @@ define(function(require) {
if
(
key
!=
'
value
'
)
{
if
(
key
!=
'
value
'
)
{
valueData
[
name
][
key
]
=
data
[
j
][
key
];
valueData
[
name
][
key
]
=
data
[
j
][
key
];
}
}
else
{
else
if
(
!
isNaN
(
data
[
j
].
value
))
{
if
(
!
isNaN
(
data
[
j
].
value
))
{
valueData
[
name
].
value
+=
data
[
j
].
value
;
valueData
[
name
].
value
+=
data
[
j
].
value
;
}
}
}
}
}
//索引有该区域的系列样式
//索引有该区域的系列样式
...
@@ -135,7 +132,7 @@ define(function(require) {
...
@@ -135,7 +132,7 @@ define(function(require) {
];
];
}
}
}
}
return
scale
return
scale
;
}
}
function
_buildMap
(
mapData
,
valueData
)
{
function
_buildMap
(
mapData
,
valueData
)
{
...
...
src/chart/scatter.js
浏览文件 @
feafbb9e
...
@@ -90,7 +90,7 @@ define(function(require) {
...
@@ -90,7 +90,7 @@ define(function(require) {
var
data
;
var
data
;
var
value
;
var
value
;
var
xAxis
;
var
xAxis
;
var
yAxis
var
yAxis
;
var
pointList
=
{};
var
pointList
=
{};
var
x
;
var
x
;
...
@@ -99,7 +99,7 @@ define(function(require) {
...
@@ -99,7 +99,7 @@ define(function(require) {
for
(
var
j
=
0
,
k
=
seriesArray
.
length
;
j
<
k
;
j
++
)
{
for
(
var
j
=
0
,
k
=
seriesArray
.
length
;
j
<
k
;
j
++
)
{
seriesIndex
=
seriesArray
[
j
];
seriesIndex
=
seriesArray
[
j
];
serie
=
series
[
seriesIndex
];
serie
=
series
[
seriesIndex
];
if
(
serie
.
data
.
length
==
0
)
{
if
(
serie
.
data
.
length
==
=
0
)
{
continue
;
continue
;
}
}
...
@@ -142,7 +142,6 @@ define(function(require) {
...
@@ -142,7 +142,6 @@ define(function(require) {
* 生成折线和折线上的拐点
* 生成折线和折线上的拐点
*/
*/
function
_buildPointList
(
pointList
)
{
function
_buildPointList
(
pointList
)
{
var
zrColor
=
require
(
'
zrender/tool/color
'
);
var
nColor
;
// normal
var
nColor
;
// normal
var
eColor
;
// emphasis
var
eColor
;
// emphasis
...
@@ -297,7 +296,7 @@ define(function(require) {
...
@@ -297,7 +296,7 @@ define(function(require) {
};
};
break
;
break
;
}
}
itemShape
.
_serieIndex
=
seriesIndex
itemShape
.
_serieIndex
=
seriesIndex
;
itemShape
.
zlevel
=
_zlevelBase
;
itemShape
.
zlevel
=
_zlevelBase
;
itemShape
.
style
.
color
=
nColor
;
itemShape
.
style
.
color
=
nColor
;
itemShape
.
style
.
strokeColor
=
nColor
;
itemShape
.
style
.
strokeColor
=
nColor
;
...
@@ -370,7 +369,6 @@ define(function(require) {
...
@@ -370,7 +369,6 @@ define(function(require) {
* 动画设定
* 动画设定
*/
*/
function
animation
()
{
function
animation
()
{
return
;
var
duration
=
self
.
deepQuery
([
option
],
'
animationDuration
'
);
var
duration
=
self
.
deepQuery
([
option
],
'
animationDuration
'
);
var
easing
=
self
.
deepQuery
([
option
],
'
animationEasing
'
);
var
easing
=
self
.
deepQuery
([
option
],
'
animationEasing
'
);
var
x
;
var
x
;
...
...
src/component/dataRange.js
浏览文件 @
feafbb9e
...
@@ -14,7 +14,7 @@ define(function (require) {
...
@@ -14,7 +14,7 @@ define(function (require) {
* @param {Object} option 图表参数
* @param {Object} option 图表参数
* @param {Object=} selected 用于状态保持
* @param {Object=} selected 用于状态保持
*/
*/
function
DataRange
(
messageCenter
,
zr
,
option
,
selected
)
{
function
DataRange
(
messageCenter
,
zr
,
option
)
{
var
Base
=
require
(
'
./base
'
);
var
Base
=
require
(
'
./base
'
);
Base
.
call
(
this
,
zr
);
Base
.
call
(
this
,
zr
);
...
@@ -75,7 +75,6 @@ define(function (require) {
...
@@ -75,7 +75,6 @@ define(function (require) {
var
textShape
;
var
textShape
;
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
zrWidth
=
zr
.
getWidth
();
var
lastX
=
_itemGroupLocation
.
x
;
var
lastX
=
_itemGroupLocation
.
x
;
var
lastY
=
_itemGroupLocation
.
y
;
var
lastY
=
_itemGroupLocation
.
y
;
var
itemWidth
=
dataRangeOption
.
itemWidth
;
var
itemWidth
=
dataRangeOption
.
itemWidth
;
...
@@ -187,19 +186,15 @@ define(function (require) {
...
@@ -187,19 +186,15 @@ define(function (require) {
* 构建渐变型的值域元素
* 构建渐变型的值域元素
*/
*/
function
_buildGradient
()
{
function
_buildGradient
()
{
var
itemName
;
var
itemShape
;
var
itemShape
;
var
textShape
;
var
textShape
;
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
font
=
self
.
getFont
(
dataRangeOption
.
textStyle
);
var
zrWidth
=
zr
.
getWidth
();
var
lastX
=
_itemGroupLocation
.
x
;
var
lastX
=
_itemGroupLocation
.
x
;
var
lastY
=
_itemGroupLocation
.
y
;
var
lastY
=
_itemGroupLocation
.
y
;
var
itemWidth
=
dataRangeOption
.
itemWidth
;
var
itemWidth
=
dataRangeOption
.
itemWidth
;
var
itemHeight
=
dataRangeOption
.
itemHeight
;
var
itemHeight
=
dataRangeOption
.
itemHeight
;
var
itemGap
=
dataRangeOption
.
itemGap
;
var
textHeight
=
zrArea
.
getTextWidth
(
'
国
'
,
font
);
var
textHeight
=
zrArea
.
getTextWidth
(
'
国
'
,
font
);
var
color
;
var
needValueText
=
true
;
var
needValueText
=
true
;
...
@@ -270,7 +265,7 @@ define(function (require) {
...
@@ -270,7 +265,7 @@ define(function (require) {
if
(
dataRangeOption
.
calculable
)
{
if
(
dataRangeOption
.
calculable
)
{
_calculableLocation
=
itemShape
.
style
;
_calculableLocation
=
itemShape
.
style
;
_buildFiller
();
_buildFiller
();
_bulidMask
()
_bulidMask
()
;
_bulidHandle
();
_bulidHandle
();
}
}
...
@@ -335,8 +330,8 @@ define(function (require) {
...
@@ -335,8 +330,8 @@ define(function (require) {
// 手柄统统在下方
// 手柄统统在下方
pointListStart
=
[
pointListStart
=
[
[
x
,
y
],
[
x
,
y
],
[
x
,
y
+
height
+
textHieght
+
textHieght
/
2
],
[
x
,
y
+
height
+
textHieght
/
2
*
3
],
[
x
-
textWidth
,
y
+
height
+
textHieght
+
textHieght
/
2
],
[
x
-
textWidth
,
y
+
height
+
textHieght
/
2
*
3
],
[
x
-
textWidth
,
y
+
height
+
textHieght
/
2
],
[
x
-
textWidth
,
y
+
height
+
textHieght
/
2
],
[
x
-
textHieght
/
2
,
y
+
height
+
textHieght
/
2
],
[
x
-
textHieght
/
2
,
y
+
height
+
textHieght
/
2
],
[
x
-
1
,
y
+
height
],
[
x
-
1
,
y
+
height
],
...
@@ -348,10 +343,10 @@ define(function (require) {
...
@@ -348,10 +343,10 @@ define(function (require) {
pointListEnd
=
[
pointListEnd
=
[
[
x
+
width
,
y
],
[
x
+
width
,
y
],
[
x
+
width
,
y
+
height
+
textHieght
+
textHieght
/
2
],
[
x
+
width
,
y
+
height
+
textHieght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
+
height
+
textHieght
+
textHieght
/
2
],
[
x
+
width
+
textWidth
,
y
+
height
+
textHieght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
+
height
+
textHieght
/
2
],
[
x
+
width
+
textWidth
,
y
+
height
+
textHieght
/
2
],
[
x
+
width
+
textHieght
/
2
,
y
+
height
+
textHieght
/
2
],
[
x
+
width
+
textHieght
/
2
,
y
+
height
+
textHieght
/
2
],
[
x
+
width
+
1
,
y
+
height
],
[
x
+
width
+
1
,
y
+
height
],
[
x
+
width
+
1
,
y
]
[
x
+
width
+
1
,
y
]
];
];
...
@@ -362,8 +357,8 @@ define(function (require) {
...
@@ -362,8 +357,8 @@ define(function (require) {
// 手柄在上方
// 手柄在上方
pointListStart
=
[
pointListStart
=
[
[
x
,
y
+
height
],
[
x
,
y
+
height
],
[
x
,
y
-
textHieght
-
textHieght
/
2
],
[
x
,
y
-
textHieght
/
2
*
3
],
[
x
-
textWidth
,
y
-
textHieght
-
textHieght
/
2
],
[
x
-
textWidth
,
y
-
textHieght
/
2
*
3
],
[
x
-
textWidth
,
y
-
textHieght
/
2
],
[
x
-
textWidth
,
y
-
textHieght
/
2
],
[
x
-
textHieght
/
2
,
y
-
textHieght
/
2
],
[
x
-
textHieght
/
2
,
y
-
textHieght
/
2
],
[
x
-
1
,
y
],
[
x
-
1
,
y
],
...
@@ -375,8 +370,8 @@ define(function (require) {
...
@@ -375,8 +370,8 @@ define(function (require) {
pointListEnd
=
[
pointListEnd
=
[
[
x
+
width
,
y
+
height
],
[
x
+
width
,
y
+
height
],
[
x
+
width
,
y
-
textHieght
-
textHieght
/
2
],
[
x
+
width
,
y
-
textHieght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
-
textHieght
-
textHieght
/
2
],
[
x
+
width
+
textWidth
,
y
-
textHieght
/
2
*
3
],
[
x
+
width
+
textWidth
,
y
-
textHieght
/
2
],
[
x
+
width
+
textWidth
,
y
-
textHieght
/
2
],
[
x
+
width
+
textHieght
/
2
,
y
-
textHieght
/
2
],
[
x
+
width
+
textHieght
/
2
,
y
-
textHieght
/
2
],
[
x
+
width
+
1
,
y
],
[
x
+
width
+
1
,
y
],
...
@@ -767,7 +762,7 @@ define(function (require) {
...
@@ -767,7 +762,7 @@ define(function (require) {
textAlign
:
(
dataRangeOption
.
orient
==
'
horizontal
'
textAlign
:
(
dataRangeOption
.
orient
==
'
horizontal
'
?
'
left
'
:
'
center
'
)
?
'
left
'
:
'
center
'
)
}
}
}
}
;
}
}
// 色尺legend item shape
// 色尺legend item shape
...
@@ -928,7 +923,7 @@ define(function (require) {
...
@@ -928,7 +923,7 @@ define(function (require) {
}
}
else
if
(
e
.
id
==
_endShape
.
id
&&
a
>=
b
)
{
else
if
(
e
.
id
==
_endShape
.
id
&&
a
>=
b
)
{
// _endShape触发
// _endShape触发
a
=
b
;
;
a
=
b
;
_startShape
.
style
.
x
=
a
;
_startShape
.
style
.
x
=
a
;
}
}
_fillerShae
.
style
.
x
=
a
;
_fillerShae
.
style
.
x
=
a
;
...
@@ -950,7 +945,7 @@ define(function (require) {
...
@@ -950,7 +945,7 @@ define(function (require) {
}
}
else
if
(
e
.
id
==
_endShape
.
id
&&
a
>=
b
)
{
else
if
(
e
.
id
==
_endShape
.
id
&&
a
>=
b
)
{
// _endShape触发
// _endShape触发
a
=
b
;
;
a
=
b
;
_startShape
.
style
.
y
=
a
;
_startShape
.
style
.
y
=
a
;
}
}
_fillerShae
.
style
.
y
=
a
;
_fillerShae
.
style
.
y
=
a
;
...
...
src/component/legend.js
浏览文件 @
feafbb9e
...
@@ -353,7 +353,7 @@ define(function (require) {
...
@@ -353,7 +353,7 @@ define(function (require) {
brushType
:
'
both
'
brushType
:
'
both
'
},
},
clickable
:
true
clickable
:
true
}
}
;
default
:
default
:
return
{
return
{
shape
:
'
rectangle
'
,
shape
:
'
rectangle
'
,
...
...
src/component/tooltip.js
浏览文件 @
feafbb9e
...
@@ -601,7 +601,7 @@ define(function (require) {
...
@@ -601,7 +601,7 @@ define(function (require) {
}
}
else
{
else
{
_tDom
.
innerHTML
=
serie
.
name
+
'
<br/>
'
+
_tDom
.
innerHTML
=
serie
.
name
+
'
<br/>
'
+
(
name
==
''
?
''
:
(
name
+
'
:
'
))
(
name
==
=
''
?
''
:
(
name
+
'
:
'
))
+
value
+
+
value
+
(
typeof
speical
==
'
undefined
'
(
typeof
speical
==
'
undefined
'
?
''
?
''
...
...
src/component/valueAxis.js
浏览文件 @
feafbb9e
...
@@ -647,7 +647,7 @@ define(function (require) {
...
@@ -647,7 +647,7 @@ define(function (require) {
}
}
}
}
_min
=
-
splitGap
*
splitNumber
+
_max
;
;
_min
=
-
splitGap
*
splitNumber
+
_max
;
}
}
else
{
else
{
// 一正一负,确保0被选中
// 一正一负,确保0被选中
...
...
src/config.js
浏览文件 @
feafbb9e
...
@@ -327,8 +327,8 @@ define(function() {
...
@@ -327,8 +327,8 @@ define(function() {
scatter
:
{
scatter
:
{
xAxisIndex
:
0
,
xAxisIndex
:
0
,
yAxisIndex
:
0
,
yAxisIndex
:
0
,
//symbol: null,
// 图形类型,非标准参数
//symbol: null, // 图形类型,非标准参数
symbolSize
:
4
// 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
symbolSize
:
4
// 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
},
},
// 饼图默认参数
// 饼图默认参数
...
...
src/util/mapData/china.js
浏览文件 @
feafbb9e
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/util/shape/symbol.js
浏览文件 @
feafbb9e
...
@@ -74,8 +74,6 @@
...
@@ -74,8 +74,6 @@
*/
*/
define
(
define
(
function
(
require
)
{
function
(
require
)
{
var
matrix
=
require
(
'
zrender/tool/matrix
'
);
function
Symbol
()
{
function
Symbol
()
{
this
.
type
=
'
symbol
'
;
this
.
type
=
'
symbol
'
;
}
}
...
@@ -166,8 +164,8 @@ define(
...
@@ -166,8 +164,8 @@ define(
buildPath
:
function
(
ctx
,
style
)
{
buildPath
:
function
(
ctx
,
style
)
{
var
pointList
=
style
.
pointList
;
var
pointList
=
style
.
pointList
;
var
rect
=
this
.
getRect
(
style
);
var
rect
=
this
.
getRect
(
style
);
console
.
log
(
rect
)
//
console.log(rect)
var
ti
=
new
Date
();
//
var ti = new Date();
var
pixels
=
ctx
.
getImageData
(
var
pixels
=
ctx
.
getImageData
(
rect
.
x
,
rect
.
y
,
rect
.
width
,
rect
.
height
rect
.
x
,
rect
.
y
,
rect
.
width
,
rect
.
height
);
);
...
@@ -190,7 +188,7 @@ define(
...
@@ -190,7 +188,7 @@ define(
data
[
idx
+
3
]
=
255
;
data
[
idx
+
3
]
=
255
;
}
}
ctx
.
putImageData
(
pixels
,
rect
.
x
,
rect
.
y
);
ctx
.
putImageData
(
pixels
,
rect
.
x
,
rect
.
y
);
console
.
log
(
new
Date
()
-
ti
);
//
console.log(new Date() - ti);
return
;
return
;
},
},
...
@@ -203,8 +201,7 @@ define(
...
@@ -203,8 +201,7 @@ define(
return
shape
.
get
(
'
polygon
'
).
getRect
(
style
);
return
shape
.
get
(
'
polygon
'
).
getRect
(
style
);
},
},
isCover
:
function
()
{
isCover
:
function
(
e
,
x
,
y
)
{
return
false
;
return
false
;
}
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录