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
fa463311
Commit
fa463311
authored
Feb 03, 2013
by
David Schnur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make redrawAttempts and shrink proper constants.
parent
77889432
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
jquery.flot.pie.js
jquery.flot.pie.js
+11
-5
No files found.
jquery.flot.pie.js
View file @
fa463311
...
...
@@ -57,6 +57,14 @@ More detail and specific examples can be found in the included HTML file.
(
function
(
$
)
{
// Maximum redraw attempts when fitting labels within the plot
var
REDRAW_ATTEMPTS
=
10
;
// Factor by which to shrink the pie when fitting labels within the plot
var
REDRAW_SHRINK
=
0.95
;
function
init
(
plot
)
{
var
canvas
=
null
,
...
...
@@ -67,8 +75,6 @@ More detail and specific examples can be found in the included HTML file.
centerLeft
=
null
,
centerTop
=
null
,
redraw
=
true
,
redrawAttempts
=
10
,
shrink
=
0.95
,
legendWidth
=
0
,
processed
=
false
,
raw
=
false
,
...
...
@@ -299,10 +305,10 @@ More detail and specific examples can be found in the included HTML file.
var
slices
=
plot
.
getData
();
var
attempts
=
0
;
while
(
redraw
&&
attempts
<
redrawAttempts
)
{
while
(
redraw
&&
attempts
<
REDRAW_ATTEMPTS
)
{
redraw
=
false
;
if
(
attempts
>
0
)
{
maxRadius
*=
shrink
;
maxRadius
*=
REDRAW_SHRINK
;
}
attempts
+=
1
;
clear
();
...
...
@@ -312,7 +318,7 @@ More detail and specific examples can be found in the included HTML file.
drawPie
();
}
if
(
attempts
>=
redrawAttempts
)
{
if
(
attempts
>=
REDRAW_ATTEMPTS
)
{
clear
();
target
.
prepend
(
"<div class='error'>Could not draw pie with labels contained inside canvas</div>"
);
}
...
...
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