Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
missman
incubator-echarts
提交
cfec12f7
I
incubator-echarts
项目概览
missman
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
cfec12f7
编写于
10月 22, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Label rotate fix
上级
b93bd09d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
27 deletion
+50
-27
src/chart/helper/createListFromArray.js
src/chart/helper/createListFromArray.js
+9
-6
src/component/axis/AngleAxisView.js
src/component/axis/AngleAxisView.js
+3
-6
src/component/axis/AxisView.js
src/component/axis/AxisView.js
+8
-1
src/component/axis/RadiusAxisView.js
src/component/axis/RadiusAxisView.js
+11
-6
test/punchCard.html
test/punchCard.html
+19
-8
未找到文件。
src/chart/helper/createListFromArray.js
浏览文件 @
cfec12f7
...
...
@@ -25,17 +25,16 @@ define(function(require) {
dimensions
=
[{
name
:
'
x
'
,
type
:
'
ordinal
'
}];
dimensions
.
push
({
},
{
name
:
'
y
'
,
// If two category axes
type
:
isYAxisCategory
?
'
ordinal
'
:
'
number
'
,
stackable
:
!
isYAxisCategory
}
)
;
}
]
;
categoryAxisModel
=
xAxisModel
;
}
else
if
(
yAxisType
===
'
category
'
)
{
else
if
(
isYAxisCategory
)
{
dimensions
=
[{
name
:
'
y
'
,
type
:
'
ordinal
'
...
...
@@ -64,18 +63,21 @@ define(function(require) {
var
angleAxisModel
=
ecModel
.
findComponent
(
'
angleAxis
'
,
axisFinder
);
var
radiusAxisModel
=
ecModel
.
findComponent
(
'
radiusAxis
'
,
axisFinder
);
var
isRadiusAxisCategory
=
radiusAxisModel
.
get
(
'
type
'
)
===
'
category
'
;
if
(
angleAxisModel
.
get
(
'
type
'
)
===
'
category
'
)
{
dimensions
=
[{
name
:
'
angle
'
,
type
:
'
ordinal
'
},
{
name
:
'
radius
'
,
stackable
:
true
// If two category axes
type
:
isRadiusAxisCategory
?
'
ordinal
'
:
'
number
'
,
stackable
:
!
isRadiusAxisCategory
}];
categoryAxisModel
=
angleAxisModel
;
}
else
if
(
radiusAxisModel
.
get
(
'
type
'
)
===
'
category
'
)
{
else
if
(
isRadiusAxisCategory
)
{
dimensions
=
[{
name
:
'
radius
'
,
type
:
'
ordinal
'
...
...
@@ -111,6 +113,7 @@ define(function(require) {
var
nameList
=
[];
if
(
categoryAxisModel
)
{
// FIXME Two category axis
var
categories
=
categoryAxisModel
.
get
(
'
data
'
);
if
(
categories
)
{
var
dataLen
=
data
.
length
;
...
...
src/component/axis/AngleAxisView.js
浏览文件 @
cfec12f7
...
...
@@ -130,7 +130,6 @@ define(function (require) {
var
splitLineModel
=
angleAxisModel
.
getModel
(
'
splitLine
'
);
var
lineStyleModel
=
splitLineModel
.
getModel
(
'
lineStyle
'
);
var
lineColors
=
lineStyleModel
.
get
(
'
color
'
);
var
lineWidth
=
lineStyleModel
.
get
(
'
width
'
);
var
lineCount
=
0
;
lineColors
=
lineColors
instanceof
Array
?
lineColors
:
[
lineColors
];
...
...
@@ -149,11 +148,9 @@ define(function (require) {
// Batching the lines if color are the same
for
(
var
i
=
0
;
i
<
splitLines
.
length
;
i
++
)
{
this
.
group
.
add
(
graphic
.
mergePath
(
splitLines
[
i
],
{
style
:
{
stroke
:
lineColors
[
i
%
lineColors
.
length
],
lineType
:
lineStyleModel
.
getLineDash
(),
lineWidth
:
lineWidth
},
style
:
zrUtil
.
defaults
({
stroke
:
lineColors
[
i
%
lineColors
.
length
]
},
lineStyleModel
.
getLineStyle
()),
silent
:
true
,
z
:
angleAxisModel
.
get
(
'
z
'
)
}));
...
...
src/component/axis/AxisView.js
浏览文件 @
cfec12f7
...
...
@@ -197,6 +197,12 @@ define(function (require) {
var
labelMargin
=
labelModel
.
get
(
'
margin
'
);
var
labelRotate
=
labelModel
.
get
(
'
rotate
'
);
var
isAxisTop
=
axis
.
position
===
'
top
'
;
if
(
isAxisTop
)
{
labelRotate
=
-
labelRotate
;
}
for
(
var
i
=
0
;
i
<
ticks
.
length
;
i
++
)
{
var
tick
=
ticks
[
i
];
if
(
ifIgnoreOnTick
(
axis
,
i
,
labelInterval
))
{
...
...
@@ -231,7 +237,8 @@ define(function (require) {
labelTextAlign
=
'
left
'
;
}
if
(
axis
.
isHorizontal
()
&&
labelRotate
)
{
labelTextAlign
=
labelRotate
>
0
?
'
left
'
:
'
right
'
;
labelTextAlign
=
(
!
isAxisTop
&&
labelRotate
<
0
)
||
(
isAxisTop
&&
labelRotate
>
0
)
?
'
left
'
:
'
right
'
;
}
var
textEl
=
new
graphic
.
Text
({
...
...
src/component/axis/RadiusAxisView.js
浏览文件 @
cfec12f7
...
...
@@ -111,6 +111,12 @@ define(function (require) {
var
p
=
[];
var
labelMargin
=
labelModel
.
get
(
'
margin
'
);
var
labelsPositions
=
axis
.
getLabelsCoords
();
var
labelRotate
=
labelModel
.
get
(
'
rotate
'
);
var
labelTextAlign
=
'
center
'
;
if
(
labelRotate
)
{
labelTextAlign
=
labelRotate
>
0
?
'
left
'
:
'
right
'
}
// FIXME Text align and text baseline when axis angle is 90 degree
for
(
var
i
=
0
;
i
<
labelsPositions
.
length
;
i
++
)
{
...
...
@@ -122,10 +128,12 @@ define(function (require) {
x
:
p
[
0
],
y
:
p
[
1
],
text
:
labels
[
i
],
textAlign
:
'
center
'
,
textAlign
:
labelTextAlign
,
textBaseline
:
'
bottom
'
,
font
:
textStyleModel
.
getFont
()
},
rotation
:
labelRotate
*
Math
.
PI
/
180
,
origin
:
p
.
slice
(),
silent
:
true
}));
};
...
...
@@ -138,7 +146,6 @@ define(function (require) {
var
splitLineModel
=
radiusAxisModel
.
getModel
(
'
splitLine
'
);
var
lineStyleModel
=
splitLineModel
.
getModel
(
'
lineStyle
'
);
var
lineColors
=
lineStyleModel
.
get
(
'
color
'
);
var
lineWidth
=
lineStyleModel
.
get
(
'
width
'
);
var
lineCount
=
0
;
lineColors
=
lineColors
instanceof
Array
?
lineColors
:
[
lineColors
];
...
...
@@ -162,12 +169,10 @@ define(function (require) {
// Batching the lines if color are the same
for
(
var
i
=
0
;
i
<
splitLines
.
length
;
i
++
)
{
this
.
group
.
add
(
graphic
.
mergePath
(
splitLines
[
i
],
{
style
:
{
style
:
zrUtil
.
defaults
(
{
stroke
:
lineColors
[
i
%
lineColors
.
length
],
lineType
:
lineStyleModel
.
getLineDash
(),
lineWidth
:
lineWidth
,
fill
:
null
},
},
lineStyleModel
.
getLineStyle
()),
silent
:
true
}));
}
...
...
test/punchCard.html
浏览文件 @
cfec12f7
...
...
@@ -9,6 +9,7 @@
html
,
body
,
#main
{
width
:
100%
;
height
:
100%
;
margin
:
0
;
}
</style>
<div
id=
"main"
></div>
...
...
@@ -19,6 +20,7 @@
'
echarts/chart/scatter
'
,
'
echarts/component/legend
'
,
'
echarts/component/grid
'
,
'
echarts/component/polar
'
,
'
echarts/component/tooltip
'
],
function
(
echarts
)
{
...
...
@@ -47,42 +49,51 @@
usedMap
[
key
]
=
true
;
data
.
push
([
x
,
y
,
Math
.
random
()
x
,
y
,
Math
.
random
()
+
0.1
])
}
chart
.
setOption
({
legend
:
{
data
:
[
'
Chart coo
rd
'
]
data
:
[
'
Punch Ca
rd
'
]
},
xAxis
:
{
polar
:
{},
angleAxis
:
{
type
:
'
category
'
,
data
:
hours
,
boundaryGap
:
false
,
splitLine
:
{
show
:
false
show
:
true
,
lineStyle
:
{
color
:
'
#ddd
'
,
type
:
'
dashed
'
}
},
axisLine
:
{
show
:
false
}
},
y
Axis
:
{
radius
Axis
:
{
type
:
'
category
'
,
data
:
days
,
axisLine
:
{
show
:
false
},
axisLabel
:
{
rotate
:
45
}
},
series
:
[{
name
:
'
Chart coo
rd
'
,
name
:
'
Punch Ca
rd
'
,
type
:
'
scatter
'
,
coordinateSystem
:
'
polar
'
,
itemStyle
:
{
normal
:
{
color
:
'
#d14a61
'
}
},
symbolSize
:
function
(
val
)
{
return
val
[
2
]
*
3
0
;
return
val
[
2
]
*
2
0
;
},
data
:
data
}]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录