Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
svg_chart
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王亚楠
svg_chart
Commits
0ccd06ef
Commit
0ccd06ef
authored
Aug 30, 2021
by
晓彤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
饼状图
parent
fdd788bc
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
271 additions
and
101 deletions
+271
-101
chart/chart.css
chart/chart.css
+17
-0
chart/chart.js
chart/chart.js
+218
-100
chart/chart.md
chart/chart.md
+1
-1
demo.html
demo.html
+35
-0
No files found.
chart/chart.css
View file @
0ccd06ef
...
...
@@ -137,3 +137,20 @@ body {
.global-svg
.hover-circle
,
.hover-line
{
opacity
:
0
;
}
.flex
{
stroke-dasharray
:
100
;
stroke-dashoffset
:
0
;
animation
:
flex-draw
5s
ease-in-out
;
/* -webkit-animation: flex-draw 5s ease-in-out; */
}
@keyframes
flex-draw
{
from
{
stroke-dashoffset
:
100
;
}
to
{
stroke-dashoffset
:
0
;
}
}
chart/chart.js
View file @
0ccd06ef
This diff is collapsed.
Click to expand it.
chart/chart.md
View file @
0ccd06ef
...
...
@@ -109,7 +109,7 @@
]
}
// 使用刚指定的配置项和数据显示图表。
myChart
.
setOption
(
option
,
'
main
'
);
myChart
.
setOption
(
option
);
</script>
</html>
```
demo.html
View file @
0ccd06ef
...
...
@@ -16,6 +16,11 @@
<div
id =
'tongbar'
width =
'425'
height =
'236'
></div>
</div>
<!-- 饼图 -->
<div
style =
'width:100%;height:400px;margin-top:100px;margin-left:100px;'
>
<div
id =
'tongpie'
width =
'425'
height =
'340'
></div>
</div>
</body>
<script
type=
"text/javascript"
src =
'./chart/chart.js'
></script>
<script
type=
"text/javascript"
>
...
...
@@ -132,5 +137,35 @@
]
}
myChartBar
.
setOption
(
optionbar
,
'
tongbar
'
);
// 饼图
var
myChartPie
=
chart
.
init
(
document
.
getElementById
(
'
tongpie
'
));
var
optionpie
=
{
series
:
[
{
type
:
'
pie
'
,
pieType
:
'
base
'
,
// base: 基础 separate: 分离 annular: 环形
data
:
[
{
value
:
5.6
,
color
:
'
red
'
,
name
:
'
1
'
},
{
value
:
1
,
color
:
'
green
'
,
name
:
'
2
'
},
{
value
:
0.8
,
color
:
'
#953C96
'
,
name
:
'
3
'
},
{
value
:
0.5
,
color
:
'
blue
'
,
name
:
'
4
'
},
{
value
:
0.5
,
color
:
'
yellow
'
,
name
:
'
5
'
},
{
value
:
3.8
,
color
:
'
pink
'
,
name
:
'
6
'
},
// {value: 1048 , color: 'red', name: '1'},
// {value: 735, color: 'green', name: '2'},
// {value: 580, color: '#953C96', name: '3'},
// {value: 484, color: 'blue', name: '4'},
// {value: 300, color: 'yellow', name: '5'},
],
style
:
{
width
:
180
,
inWidth
:
111
,
}
}
]
};
myChartPie
.
setOption
(
optionpie
,
'
tongpie
'
);
</script>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment