Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
cdbcf42f
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,体验更适合开发者的 AI 搜索 >>
提交
cdbcf42f
编写于
4月 23, 2015
作者:
L
loutongbing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改了韦恩图的配置
上级
946dc2a7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
184 addition
and
31 deletion
+184
-31
doc/doc.html
doc/doc.html
+0
-7
doc/example/venn.html
doc/example/venn.html
+2
-2
doc/example/venn1.html
doc/example/venn1.html
+157
-0
src/chart/venn.js
src/chart/venn.js
+25
-22
未找到文件。
doc/doc.html
浏览文件 @
cdbcf42f
...
...
@@ -3773,13 +3773,6 @@ indicator : [
<td>
null
</td>
<td>
数据值
</td>
</tr>
<tr>
<td>
<b>
{String}
</b>
color
</td>
<td>
系统配色
</td>
<td>
颜色,用16进制表示,例如:'#999933'
</td>
</tr>
<tr>
<td>
<b>
{Object}
</b>
itemStyle
</td>
<td>
{}
</td>
...
...
doc/example/venn.html
浏览文件 @
cdbcf42f
...
...
@@ -89,8 +89,8 @@ option = {
}
},
data:[
{value:100, name:'访问'
,color: '#999933'
},
{value:50, name:'咨询'
,color: '#669999'
},
{value:100, name:'访问'},
{value:50, name:'咨询'},
{value:20, name:'公共'}
]
}
...
...
doc/example/venn1.html
0 → 100644
浏览文件 @
cdbcf42f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"description"
content=
"ECharts"
>
<meta
name=
"author"
content=
"kener.linfeng@gmail.com"
>
<title>
ECharts · Example
</title>
<link
rel=
"shortcut icon"
href=
"../asset/ico/favicon.png"
>
<link
href=
"../asset/css/font-awesome.min.css"
rel=
"stylesheet"
>
<link
href=
"../asset/css/bootstrap.css"
rel=
"stylesheet"
>
<link
href=
"../asset/css/carousel.css"
rel=
"stylesheet"
>
<link
href=
"../asset/css/echartsHome.css"
rel=
"stylesheet"
>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script
src=
"./www/js/echarts.js"
></script>
<script
src=
"../asset/js/codemirror.js"
></script>
<script
src=
"../asset/js/javascript.js"
></script>
<link
href=
"../asset/css/codemirror.css"
rel=
"stylesheet"
>
<link
href=
"../asset/css/monokai.css"
rel=
"stylesheet"
>
</head>
<body>
<!-- Fixed navbar -->
<div
class=
"navbar navbar-default navbar-fixed-top"
role=
"navigation"
id=
"head"
></div>
<div
class=
"container-fluid"
>
<div
class=
"row-fluid example"
>
<div
id=
"sidebar-code"
class=
"col-md-4"
>
<div
class=
"well sidebar-nav"
>
<div
class=
"nav-header"
><a
href=
"#"
onclick=
"autoResize()"
class=
"glyphicon glyphicon-resize-full"
id =
"icon-resize"
></a>
option
</div>
<textarea
id=
"code"
name=
"code"
>
option = {
title : {
text: '访问 vs 咨询',
subtext: '配置的例子'
},
tooltip : {
trigger: 'item',
formatter: "{b}: {c}"
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : false,
series : [
{
name:'韦恩图',
type:'venn',
itemStyle: {
normal: {
label: {
show: true,
textStyle: {
fontFamily: 'Arial, Verdana, sans-serif',
fontSize: 16,
fontStyle: 'italic',
fontWeight: 'bolder'
}
},
labelLine: {
show: false,
length: 10,
lineStyle: {
// color: 各异,
width: 1,
type: 'solid'
}
}
},
emphasis: {
color: '#cc99cc',
borderWidth: 3,
borderColor: '#996699'
}
},
data:[
{
value:100,
name:'访问',
itemStyle: {
normal: {
color: '#99cccc'
},
emphasis: {
color: '#2ec7c0',
borderWidth: 3,
borderColor: '#ffffcc'
}
}
},
{
value:50,
name:'咨询',
itemStyle: {
normal: {
color: '#99ccff'
}
}
},
{
value:20,
name:'公共',
itemStyle: {
normal: {
color: '#9999cc'
},
emphasis: {
color: '#ccffcc'
}
}
}
]
}
]
};
</textarea>
</div>
<!--/.well -->
</div>
<!--/span-->
<div
id=
"graphic"
class=
"col-md-8"
>
<div
id=
"main"
class=
"main"
></div>
<div>
<button
type=
"button"
class=
"btn btn-sm btn-success"
onclick=
"refresh(true)"
>
刷 新
</button>
<span
class=
"text-primary"
>
切换主题
</span>
<select
id=
"theme-select"
></select>
<span
id=
'wrong-message'
style=
"color:red"
></span>
</div>
</div>
<!--/span-->
</div>
<!--/row-->
</div>
<!--/.fluid-container-->
<footer
id=
"footer"
></footer>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script
src=
"../asset/js/jquery.min.js"
></script>
<script
type=
"text/javascript"
src=
"../asset/js/echartsHome.js"
></script>
<script
src=
"../asset/js/bootstrap.min.js"
></script>
<script
src=
"../asset/js/echartsExample.js"
></script>
</body>
</html>
src/chart/venn.js
浏览文件 @
cdbcf42f
...
...
@@ -95,14 +95,12 @@ define(function (require) {
var
y
=
this
.
zr
.
getHeight
()
/
2
;
this
.
_buildItem
(
0
,
0
,
data
[
0
].
color
||
this
.
zr
.
getColor
(
0
),
x0
,
y
,
r0
);
this
.
_buildItem
(
0
,
1
,
data
[
1
].
color
||
this
.
zr
.
getColor
(
1
),
x1
,
y
,
r1
...
...
@@ -132,8 +130,7 @@ define(function (require) {
rightLargeArcFlag
=
1
;
}
this
.
_buildCoincideItem
(
2
,
2
,
data
[
2
].
color
||
this
.
zr
.
getColor
(
2
),
2
,
x0
+
xLeft
,
y
-
h
,
y
+
h
,
...
...
@@ -203,13 +200,13 @@ define(function (require) {
* 构建单个圆及指标
*/
_buildItem
:
function
(
seriesIndex
,
dataIndex
,
defaultColor
,
seriesIndex
,
dataIndex
,
x
,
y
,
r
)
{
var
series
=
this
.
series
;
var
circle
=
this
.
getCircle
(
seriesIndex
,
dataIndex
,
defaultColor
,
dataIndex
,
x
,
y
,
r
);
ecData
.
pack
(
...
...
@@ -223,7 +220,7 @@ define(function (require) {
if
(
series
[
0
].
itemStyle
.
normal
.
label
.
show
)
{
// 文本标签
var
label
=
this
.
getLabel
(
seriesIndex
,
dataIndex
,
defaultColor
,
dataIndex
,
x
,
y
,
r
);
ecData
.
pack
(
...
...
@@ -237,7 +234,7 @@ define(function (require) {
},
_buildCoincideItem
:
function
(
seriesIndex
,
dataIndex
,
defaultColor
,
dataIndex
,
x
,
y0
,
y1
,
r0
,
r1
,
rightLargeArcFlag
,
leftLargeArcFlag
)
{
var
series
=
this
.
series
;
...
...
@@ -254,15 +251,14 @@ define(function (require) {
queryTarget
,
'
itemStyle.emphasis
'
)
||
{};
var
emphasisColor
=
this
.
getItemStyleColor
(
emphasis
.
color
,
seriesIndex
,
dataIndex
,
data
)
||
defaultColor
;
var
normalColor
=
normal
.
color
||
this
.
zr
.
getColor
(
dataIndex
);
var
emphasisColor
=
emphasis
.
color
||
this
.
zr
.
getColor
(
dataIndex
);
var
path
=
'
M
'
+
x
+
'
,
'
+
y0
+
'
A
'
+
r0
+
'
,
'
+
r0
+
'
,0,
'
+
rightLargeArcFlag
+
'
,1,
'
+
x
+
'
,
'
+
y1
+
'
A
'
+
r1
+
'
,
'
+
r1
+
'
,0,
'
+
leftLargeArcFlag
+
'
,1,
'
+
x
+
'
,
'
+
y0
;
var
style
=
{
color
:
default
Color
,
color
:
normal
Color
,
// path: rx ry x-axis-rotation large-arc-flag sweep-flag x y
path
:
path
};
...
...
@@ -293,7 +289,7 @@ define(function (require) {
* 构建圆形
*/
getCircle
:
function
(
seriesIndex
,
dataIndex
,
defaultColor
,
dataIndex
,
x
,
y
,
r
)
{
var
serie
=
this
.
series
[
0
];
...
...
@@ -309,9 +305,8 @@ define(function (require) {
queryTarget
,
'
itemStyle.emphasis
'
)
||
{};
var
emphasisColor
=
this
.
getItemStyleColor
(
emphasis
.
color
,
seriesIndex
,
dataIndex
,
data
)
||
defaultColor
;
var
normalColor
=
normal
.
color
||
this
.
zr
.
getColor
(
dataIndex
);
var
emphasisColor
=
emphasis
.
color
||
this
.
zr
.
getColor
(
dataIndex
);
var
circle
=
{
zlevel
:
this
.
getZlevelBase
(),
...
...
@@ -322,8 +317,8 @@ define(function (require) {
r
:
r
,
brushType
:
'
fill
'
,
opacity
:
1
,
color
:
default
Color
}
,
color
:
normal
Color
},
highlightStyle
:
{
color
:
emphasisColor
,
lineWidth
:
emphasis
.
borderWidth
,
...
...
@@ -343,18 +338,26 @@ define(function (require) {
* 需要显示则会有返回构建好的shape,否则返回undefined
*/
getLabel
:
function
(
seriesIndex
,
dataIndex
,
defaultColor
,
dataIndex
,
x
,
y
,
r
)
{
var
serie
=
this
.
series
[
0
];
var
itemStyle
=
serie
.
itemStyle
;
var
data
=
this
.
data
[
dataIndex
];
var
queryTarget
=
[
data
,
serie
];
// 多级控制
var
normal
=
this
.
deepMerge
(
queryTarget
,
'
itemStyle.normal
'
)
||
{};
var
status
=
'
normal
'
;
// label配置
var
labelControl
=
itemStyle
[
status
].
label
;
var
textStyle
=
labelControl
.
textStyle
||
{};
var
text
=
this
.
getLabelText
(
seriesIndex
,
dataIndex
,
status
);
var
text
=
this
.
getLabelText
(
dataIndex
,
status
);
var
textFont
=
this
.
getFont
(
textStyle
);
var
textColor
=
defaultColor
;
var
textColor
=
normal
.
color
||
this
.
zr
.
getColor
(
dataIndex
)
;
// 求出label的纵坐标
var
textSize
=
textStyle
.
fontSize
||
12
;
...
...
@@ -376,7 +379,7 @@ define(function (require) {
/**
* 根据lable.format计算label text
*/
getLabelText
:
function
(
seriesIndex
,
dataIndex
,
status
)
{
getLabelText
:
function
(
dataIndex
,
status
)
{
var
series
=
this
.
series
;
var
serie
=
series
[
0
];
var
data
=
serie
.
data
[
dataIndex
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录