Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
23cdb299
Commit
23cdb299
authored
May 02, 2012
by
David Schnur
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21 from reustle/master
Prevent single slice pie charts on example page
parents
eafe69a4
98ca809a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
pie.html
examples/pie.html
+11
-9
No files found.
examples/pie.html
View file @
23cdb299
...
...
@@ -10,27 +10,30 @@
<script
type=
"text/javascript"
>
$
(
function
()
{
// data
/*var data = [
/*
// Example Data
var data = [
{ label: "Series1", data: 10},
{ label: "Series2", data: 30},
{ label: "Series3", data: 90},
{ label: "Series4", data: 70},
{ label: "Series5", data: 80},
{ label: "Series6", data: 110}
];
*/
/*
var data = [
];
var data = [
{ label: "Series1", data: [[1,10]]},
{ label: "Series2", data: [[1,30]]},
{ label: "Series3", data: [[1,90]]},
{ label: "Series4", data: [[1,70]]},
{ label: "Series5", data: [[1,80]]},
{ label: "Series6", data: [[1,0]]}
];*/
];
*/
// Randomly Generated Data
var
data
=
[];
var
series
=
Math
.
floor
(
Math
.
random
()
*
10
)
+
1
;
for
(
var
i
=
0
;
i
<
series
;
i
++
)
{
var
series
=
Math
.
floor
(
Math
.
random
()
*
6
)
+
3
;
for
(
var
i
=
0
;
i
<
series
;
i
++
){
data
[
i
]
=
{
label
:
"Series"
+
(
i
+
1
),
data
:
Math
.
floor
(
Math
.
random
()
*
100
)
+
1
}
}
...
...
@@ -512,7 +515,6 @@ $.plot($("#graph5"), data, <br/>
<div
id=
"graph6"
class=
"graph"
></div>
<label
for=
"graph6"
>
Labels can be hidden if the slice is less than a given percentage of the pie (10% in this case).
<br><span
style=
"color: red"
>
Note: you may need to refresh the page to see this effect.
</span>
<code>
$.plot($("#graph6"), data,
<br/>
{
<br/>
...
...
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