Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
jml0128
/
xrk-bi
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d11be1e7
authored
May 09, 2022
by
jml0128
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:数字问卷增加双环图表
1 parent
1ae7c536
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
5 deletions
package.json
src/packages/bi/src/chart-type/pie/createPie.js
src/packages/bi/src/chart-type/types.js
src/packages/bi/src/commonComponents/types-chart.vue
src/packages/bi/src/project/21-digitalQuestionnaire.vue
package.json
View file @
d11be1e
{
"name"
:
"xrk-bi"
,
"version"
:
"0.3.0-beta.1
2
"
,
"version"
:
"0.3.0-beta.1
3
"
,
"description"
:
"xrk-bi"
,
"author"
:
"xrk"
,
"main"
:
"dist/bundler.js"
,
...
...
src/packages/bi/src/chart-type/pie/createPie.js
View file @
d11be1e
...
...
@@ -167,3 +167,96 @@ export const createPie = (
]
};
};
export
const
createDoubleRing
=
(
Vue
,
chartData
,
axisData
,
yAxisUnit
,
colors
=
[]
)
=>
{
const
{
fontSize
,
isMobile
,
isPrint
}
=
getInfo
(
Vue
);
chartData
=
chartData
[
0
]
||
[];
const
isSingle
=
chartData
.
length
==
1
;
return
{
animation
:
false
,
grid
:
{
containLabel
:
true
,
left
:
20
,
right
:
0
,
bottom
:
'5%'
},
title
:
isMobile
?
{
borderColor
:
'#fff'
,
text
:
10000
+
'人'
,
textStyle
:
{
color
:
'#2A3558'
,
fontSize
:
isPrint
?
45
:
15
},
subtext
:
'答题人数'
,
subtextStyle
:
{
color
:
'#6F7A91'
,
fontSize
:
isPrint
?
30
:
10
},
itemGap
:
isPrint
?
12
:
4
,
left
:
'center'
,
top
:
isPrint
?
'45%'
:
'42%'
}
:
{
borderColor
:
'#fff'
},
series
:
chartData
.
map
((
item
,
index
)
=>
{
const
maxWidth
=
75
;
const
getRadius
=
index
=>
{
if
(
isSingle
)
{
return
isMobile
?
[
'35%'
,
'55%'
]
:
[
'70%'
,
'55%'
];
}
const
width
=
15
;
const
gap
=
width
*
1.5
;
return
[
`
${
maxWidth
-
gap
*
index
-
width
}
%`
,
`
${
maxWidth
-
gap
*
index
}
%`
];
};
const
_item
=
[
item
].
map
(
cItem
=>
{
return
{
name
:
`
${
axisData
[
index
]}
`
,
value
:
cItem
};
});
return
{
type
:
'pie'
,
z
:
index
,
zlevel
:
index
,
center
:
[
'50%'
,
'50%'
],
radius
:
getRadius
(
index
),
clockwise
:
true
,
hoverOffset
:
15
,
itemStyle
:
{
color
:
function
()
{
return
colors
[
index
%
colors
.
length
];
}
},
label
:
{
show
:
true
,
position
:
'outside'
,
fontSize
:
fontSize
,
color
:
'#2A3558'
,
formatter
:
'{b}:{c}'
},
labelLine
:
{
show
:
true
,
lineStyle
:
{
color
:
'#6E6E6E'
,
width
:
1
}
},
labelLayout
:
{
hideOverlap
:
false
},
data
:
_item
};
})
};
};
src/packages/bi/src/chart-type/types.js
View file @
d11be1e
...
...
@@ -9,7 +9,7 @@ import {
createBarMultipleTransverse
}
from
'./bar/createBar'
;
import
{
createLine
,
createLineSmooth
}
from
'./line/createLine'
;
import
{
createPie
,
createRing
}
from
'./pie/createPie'
;
import
{
createPie
,
createRing
,
createDoubleRing
}
from
'./pie/createPie'
;
import
{
createMap
,
createMapScatter
}
from
'./map/createMap'
;
export
default
{
// 柱状
...
...
@@ -90,6 +90,14 @@ export default {
icon
:
'http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/bingtu1.svg'
,
create
:
createPie
},
// 双层圆环
16
:
{
name
:
'double-ring'
,
cnName
:
'饼图'
,
sort
:
2
,
icon
:
'http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/bingtu3.svg'
,
create
:
createDoubleRing
},
// 表格
11
:
{
name
:
'table'
,
...
...
src/packages/bi/src/commonComponents/types-chart.vue
View file @
d11be1e
...
...
@@ -55,7 +55,8 @@ export default {
if
(
this
.
extendTypes
.
includes
(
+
item
[
0
]))
{
return
true
;
}
else
{
return
item
[
0
]
!=
12
;
// 双环、男女性别类型
return
!
[
12
,
16
,
'12'
,
'16'
].
includes
(
item
[
0
]);
}
})
.
reduce
((
pre
,
[
key
,
value
])
=>
{
...
...
src/packages/bi/src/project/21-digitalQuestionnaire.vue
View file @
d11be1e
...
...
@@ -40,7 +40,7 @@
:textData=
"textDataHistory"
:singleChoice=
"showSingleChoiceHistory"
:pageWrap=
"true"
@
sort=
"sort(arguments, 'singleChoice', hideSingleChoiceHistory)"
@
sort=
"sort(arguments, 'singleChoice
History
', hideSingleChoiceHistory)"
@
page=
"setPage(arguments, 'page2', 'page2Info')"
>
<BiSingleChoiceInfo
...
...
@@ -470,7 +470,13 @@ export default {
hideDesc
:
true
},
7
:
{
hideThisChart
:
true
},
23
:
{
hideThisChart
:
true
}
23
:
item
=>
({
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
16
]),
blockTitle
:
'专区推广文章浏览量与有效反馈数量对比图'
,
hideDesc
:
true
,
extendTypes
:
[
16
],
disableTypes
:
[
3
,
4
,
5
,
6
,
9
,
10
,
11
]
})
};
this
[
singleChoiceName
]
=
Object
.
entries
(
obj
)
.
filter
(
item
=>
item
[
1
])
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment