Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
27d270e1
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,发现更多精彩内容 >>
提交
27d270e1
编写于
10月 30, 2019
作者:
M
make it right
提交者:
Yi Shen
10月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix component type can't change bug #11000
* fix bug #11000 * fix bug #11000
上级
82ebc4d1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
386 addition
and
192 deletion
+386
-192
src/model/Global.js
src/model/Global.js
+1
-1
test/dataZoom-extreme.html
test/dataZoom-extreme.html
+237
-191
test/legend-scroll2plain.html
test/legend-scroll2plain.html
+148
-0
未找到文件。
src/model/Global.js
浏览文件 @
27d270e1
...
...
@@ -212,7 +212,7 @@ var GlobalModel = Model.extend({
mainType
,
resultItem
.
keyInfo
.
subType
,
true
);
if
(
componentModel
&&
componentModel
instanceof
ComponentModelClass
)
{
if
(
componentModel
&&
componentModel
.
constructor
===
ComponentModelClass
)
{
componentModel
.
name
=
resultItem
.
keyInfo
.
name
;
// componentModel.settingTask && componentModel.settingTask.dirty();
componentModel
.
mergeOption
(
newCptOption
,
this
);
...
...
test/dataZoom-extreme.html
浏览文件 @
27d270e1
...
...
@@ -20,227 +20,273 @@ under the License.
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<script
src=
"lib/esl.js"
></script>
<script
src=
"lib/config.js"
></script>
<script
src=
"lib/jquery.min.js"
></script>
<script
src=
"lib/facePrint.js"
></script>
<script
src=
"lib/testHelper.js"
></script>
<link
rel=
"stylesheet"
href=
"lib/reset.css"
/>
</head>
<body>
<style>
.test-title
{
background
:
#146402
;
color
:
#fff
;
}
</style>
<div
id=
"main0"
></div>
<div
id=
"main1"
></div>
<div
id=
"main2"
></div>
<script>
var
chart
;
var
myChart
;
var
option
;
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
// Thanks to
<
https
:
//github.com/vision57>
// See
<
https
:
//github.com/ecomfe/echarts/issues/7666>
function
createParams
()
{
var
notMerge
=
true
;
var
option
=
{
dataZoom
:
[{
type
:
'
inside
'
},
{
type
:
'
slider
'
}],
xAxis
:
{
type
:
'
time
'
},
yAxis
:
{
type
:
'
value
'
},
series
:
[]
};
return
{
title
:
'
series empty, should no exception.
'
,
notMerge
:
notMerge
,
option
:
option
,
info
:
option
};
}
chart
=
myChart
=
testHelper
.
create
(
echarts
,
'
main0
'
,
createParams
());
if
(
chart
)
{
// Set option again with notMerge mode.
chart
.
setOption
(
createParams
().
option
,
true
);
}
});
</script>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<script
src=
"lib/esl.js"
></script>
<script
src=
"lib/config.js"
></script>
<script
src=
"lib/jquery.min.js"
></script>
<script
src=
"lib/facePrint.js"
></script>
<script
src=
"lib/testHelper.js"
></script>
<link
rel=
"stylesheet"
href=
"lib/reset.css"
/>
</head>
<body>
<style>
.test-title
{
background
:
#146402
;
color
:
#fff
;
}
</style>
<div
id=
"main0"
></div>
<div
id=
"main1"
></div>
<div
id=
"main2"
></div>
<div
id=
"main3"
></div>
<script>
var
chart
;
var
myChart
;
var
option
;
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
<script>
// Thanks to
<
https
:
//github.com/vision57>
// See
<
https
:
//github.com/ecomfe/echarts/issues/7666>
// See https://github.com/ecomfe/echarts/issues/7955
// Thanks to https://github.com/cbtpro
require
([
'
echarts
'
,
'
extension/bmap
'
],
function
(
echarts
)
{
function
createParams
()
{
var
notMerge
=
true
;
var
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
},
toolbox
:
{
feature
:
{
saveAsImage
:
{}
}
},
dataZoom
:
[{
type
:
'
inside
'
},
{
type
:
'
slider
'
}],
xAxis
:
{
type
:
'
category
'
,
data
:
[
'
Mon
'
,
'
Tue
'
,
'
Wed
'
,
'
Thu
'
,
'
Fri
'
,
'
Sat
'
,
'
Sun
'
]
type
:
'
time
'
},
yAxis
:
{
type
:
'
value
'
},
series
:
[
{
name
:
'
Step Start
'
,
type
:
'
line
'
,
step
:
'
start
'
,
data
:[
120
,
132
,
null
,
134
,
90
,
230
,
210
]
},
{
name
:
'
Step Middle
'
,
type
:
'
line
'
,
step
:
'
middle
'
,
data
:[
220
,
282
,
201
,
234
,
null
,
430
,
410
]
}
]
}
var
chart
=
testHelper
.
create
(
echarts
,
'
main1
'
,
{
title
:
'
When toolbox.dataZoom enabled, line should keep broken.
'
,
series
:
[]
};
return
{
title
:
'
series empty, should no exception.
'
,
notMerge
:
notMerge
,
option
:
option
,
button
:
{
text
:
'
Click enable toolbox.dataZoom
'
,
onClick
:
function
()
{
chart
.
setOption
({
toolbox
:
{
feature
:
{
dataZoom
:
{}
}
},
// xAxis: {
// type: 'category',
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
// },
// yAxis: {
// type: 'value'
// },
// series: [
// {
// name:'Step Start',
// type:'line',
// step: 'start',
// data:[120, 132, null, 134, 90, 230, 210]
// },
// {
// name:'Step Middle',
// type:'line',
// step: 'middle',
// data:[220, 282, 201, 234, null, 430, 410]
// },
// {
// name:'Step End',
// type:'line',
// step: 'end',
// data:[450, 432, 401, 454, 590, null, 510]
// }
// ]
});
}
info
:
option
};
}
chart
=
myChart
=
testHelper
.
create
(
echarts
,
'
main0
'
,
createParams
());
if
(
chart
)
{
// Set option again with notMerge mode.
chart
.
setOption
(
createParams
().
option
,
true
);
}
});
</script>
<script>
// See https://github.com/ecomfe/echarts/issues/7955
// Thanks to https://github.com/cbtpro
require
([
'
echarts
'
,
'
extension/bmap
'
],
function
(
echarts
)
{
var
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
},
toolbox
:
{
feature
:
{
saveAsImage
:
{}
}
});
},
xAxis
:
{
type
:
'
category
'
,
data
:
[
'
Mon
'
,
'
Tue
'
,
'
Wed
'
,
'
Thu
'
,
'
Fri
'
,
'
Sat
'
,
'
Sun
'
]
},
yAxis
:
{
type
:
'
value
'
},
series
:
[
{
name
:
'
Step Start
'
,
type
:
'
line
'
,
step
:
'
start
'
,
data
:
[
120
,
132
,
null
,
134
,
90
,
230
,
210
]
},
{
name
:
'
Step Middle
'
,
type
:
'
line
'
,
step
:
'
middle
'
,
data
:
[
220
,
282
,
201
,
234
,
null
,
430
,
410
]
}
]
}
var
chart
=
testHelper
.
create
(
echarts
,
'
main1
'
,
{
title
:
'
When toolbox.dataZoom enabled, line should keep broken.
'
,
option
:
option
,
button
:
{
text
:
'
Click enable toolbox.dataZoom
'
,
onClick
:
function
()
{
chart
.
setOption
({
toolbox
:
{
feature
:
{
dataZoom
:
{}
}
},
// xAxis: {
// type: 'category',
// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
// },
// yAxis: {
// type: 'value'
// },
// series: [
// {
// name:'Step Start',
// type:'line',
// step: 'start',
// data:[120, 132, null, 134, 90, 230, 210]
// },
// {
// name:'Step Middle',
// type:'line',
// step: 'middle',
// data:[220, 282, 201, 234, null, 430, 410]
// },
// {
// name:'Step End',
// type:'line',
// step: 'end',
// data:[450, 432, 401, 454, 590, null, 510]
// }
// ]
});
}
}
});
</script>
});
</script>
<script>
require
([
'
echarts
'
,
'
extension/bmap
'
],
function
(
echarts
)
{
<script>
var
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
},
xAxis
:
{
},
yAxis
:
{
require
([
'
echarts
'
,
'
extension/bmap
'
],
function
(
echarts
)
{
var
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
},
xAxis
:
{
},
yAxis
:
{
},
series
:
[
{
name
:
'
Step Start
'
,
type
:
'
line
'
,
data
:
[[
12
,
120
],
[
23
,
132
],
null
,
[
19
,
134
],
[
45
,
90
]]
},
series
:
[
{
name
:
'
Step Start
'
,
type
:
'
line
'
,
data
:[[
12
,
120
],
[
23
,
132
],
null
,
[
19
,
134
],
[
45
,
90
]]
},
{
name
:
'
Step Middle
'
,
type
:
'
line
'
,
data
:[[
42
,
120
],
[
53
,
132
],
[
null
,
55
],
[
49
,
134
],
[
15
,
90
]]
}
]
}
{
name
:
'
Step Middle
'
,
type
:
'
line
'
,
data
:
[[
42
,
120
],
[
53
,
132
],
[
null
,
55
],
[
49
,
134
],
[
15
,
90
]]
}
]
}
var
chart
=
testHelper
.
create
(
echarts
,
'
main2
'
,
{
title
:
'
Add dataZoom, and zoom data, line should keep broken
'
,
option
:
option
,
button
:
{
text
:
'
Click to add dataZoom
'
,
onClick
:
function
()
{
chart
.
setOption
({
dataZoom
:
[{
},
{
type
:
'
inside
'
}]
})
}
var
chart
=
testHelper
.
create
(
echarts
,
'
main2
'
,
{
title
:
'
Add dataZoom, and zoom data, line should keep broken
'
,
option
:
option
,
button
:
{
text
:
'
Click to add dataZoom
'
,
onClick
:
function
()
{
chart
.
setOption
({
dataZoom
:
[{
},
{
type
:
'
inside
'
}]
})
}
}
);
}
});
});
</script>
<script>
require
([
'
echarts
'
,
'
extension/bmap
'
],
function
(
echarts
)
{
var
option
=
{
tooltip
:
{
trigger
:
'
axis
'
},
legend
:
{
},
dataZoom
:
[
{
type
:
'
slider
'
}
],
xAxis
:
{
},
yAxis
:
{
},
series
:
[
{
name
:
'
Step Middle
'
,
type
:
'
line
'
,
data
:
[[
42
,
120
],
[
53
,
132
],
[
null
,
55
],
[
49
,
134
],
[
15
,
90
]]
}
]
}
var
chart
=
testHelper
.
create
(
echarts
,
'
main3
'
,
{
title
:
'
Add dataZoom, and the type of dataZoom should change to inside after 3s
'
,
option
:
option
});
setTimeout
(
function
()
{
option
.
dataZoom
[
0
].
type
=
'
inside
'
;
chart
.
setOption
(
option
);
},
3000
);
});
</script>
</script>
...
...
@@ -249,6 +295,6 @@ under the License.
</body>
</body>
</html>
\ No newline at end of file
test/legend-scroll2plain.html
0 → 100644
浏览文件 @
27d270e1
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<script
src=
"lib/esl.js"
></script>
<script
src=
"lib/config.js"
></script>
<script
src=
"lib/jquery.min.js"
></script>
<script
src=
"lib/facePrint.js"
></script>
<script
src=
"lib/testHelper.js"
></script>
<!-- <script src="ut/lib/canteen.js"></script> -->
<link
rel=
"stylesheet"
href=
"lib/reset.css"
/>
</head>
<body>
<style>
</style>
<div
id=
"main0"
></div>
<script>
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
var
option
;
// $.getJSON('./data/nutrients.json', function (data) {});
option
=
{
title
:
{
text
:
'
浏览器占比变化
'
,
subtext
:
'
纯属虚构
'
,
top
:
10
,
left
:
10
},
tooltip
:
{
trigger
:
'
item
'
,
backgroundColor
:
'
rgba(0,0,250,0.2)
'
},
legend
:
{
type
:
'
scroll
'
,
bottom
:
10
,
data
:
(
function
()
{
var
list
=
[];
for
(
var
i
=
1
;
i
<=
28
;
i
++
)
{
list
.
push
(
i
+
2000
+
''
);
}
return
list
;
})()
},
visualMap
:
{
top
:
'
middle
'
,
right
:
10
,
color
:
[
'
red
'
,
'
yellow
'
],
calculable
:
true
},
radar
:
{
indicator
:
[
{
text
:
'
IE8-
'
,
max
:
400
},
{
text
:
'
IE9+
'
,
max
:
400
},
{
text
:
'
Safari
'
,
max
:
400
},
{
text
:
'
Firefox
'
,
max
:
400
},
{
text
:
'
Chrome
'
,
max
:
400
}
]
},
series
:
(
function
()
{
var
series
=
[];
for
(
var
i
=
1
;
i
<=
28
;
i
++
)
{
series
.
push
({
name
:
'
浏览器(数据纯属虚构)
'
,
type
:
'
radar
'
,
symbol
:
'
none
'
,
lineStyle
:
{
width
:
1
},
emphasis
:
{
areaStyle
:
{
color
:
'
rgba(0,250,0,0.3)
'
}
},
data
:
[
{
value
:
[
(
40
-
i
)
*
10
,
(
38
-
i
)
*
4
+
60
,
i
*
5
+
10
,
i
*
9
,
i
*
i
/
2
],
name
:
i
+
2000
+
''
}
]
});
}
return
series
;
})()
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main0
'
,
{
title
:
[
'
Test Case Description of main0
'
,
'
(Muliple lines and **emphasis** are supported in description)
'
],
option
:
option
// height: 300,
// buttons: [{text: 'btn-txt', onclick: function () {}}],
// recordCanvas: true,
});
setTimeout
(
function
()
{
option
.
legend
.
type
=
'
plain
'
;
chart
.
setOption
(
option
);
},
3000
);
});
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录