Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
charts
c3-closed
Commits
a320d662
Commit
a320d662
authored
May 22, 2014
by
Brandon Bernal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spacing and Tabbing reported by Travis CI.
parent
e29f418c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
32 deletions
+34
-32
c3.js
c3.js
+34
-32
No files found.
c3.js
View file @
a320d662
...
...
@@ -515,7 +515,7 @@
function
updateRadius
()
{
radiusExpanded
=
Math
.
min
(
arcWidth
,
arcHeight
)
/
2
;
radius
=
radiusExpanded
*
0.95
;
var
innerRadiusRatio
=
__gauge_width
?
((
radius
-
__gauge_width
)
/
radius
)
:
0.6
;
var
innerRadiusRatio
=
__gauge_width
?
((
radius
-
__gauge_width
)
/
radius
)
:
0.6
;
innerRadius
=
hasDonutType
(
c3
.
data
.
targets
)
||
hasGaugeType
(
c3
.
data
.
targets
)
?
radius
*
innerRadiusRatio
:
0
;
}
function
getSvgLeft
()
{
...
...
@@ -991,14 +991,16 @@
d
=
t
;
}
});
if
(
isNaN
(
d
.
endAngle
))
d
.
endAngle
=
d
.
startAngle
;
if
(
isNaN
(
d
.
endAngle
))
{
d
.
endAngle
=
d
.
startAngle
;
}
if
(
isGaugeType
(
d
.
data
))
{
var
sA
=
d
.
startAngle
,
eA
=
d
.
endAngle
;
var
gMin
=
__gauge_min
,
gMax
=
__gauge_max
,
gF
=
Math
.
abs
(
gMin
)
+
gMax
,
fA
=
Math
.
abs
(
sA
)
+
eA
,
aTic
=
(
Math
.
PI
)
/
gF
;
d
.
startAngle
=
(
-
1
*
(
Math
.
PI
/
2
))
+
(
aTic
*
Math
.
abs
(
gMin
));
d
.
endAngle
=
d
.
startAngle
+
(
aTic
*
(
(
d
.
value
>
gMax
)
?
gMax
:
d
.
value
));
var
sA
=
d
.
startAngle
,
eA
=
d
.
endAngle
;
var
gMin
=
__gauge_min
,
gMax
=
__gauge_max
,
gF
=
Math
.
abs
(
gMin
)
+
gMax
,
fA
=
Math
.
abs
(
sA
)
+
eA
,
aTic
=
(
Math
.
PI
)
/
gF
;
d
.
startAngle
=
(
-
1
*
(
Math
.
PI
/
2
))
+
(
aTic
*
Math
.
abs
(
gMin
));
d
.
endAngle
=
d
.
startAngle
+
(
aTic
*
(
(
d
.
value
>
gMax
)
?
gMax
:
d
.
value
));
}
return
found
?
d
:
null
;
}
...
...
@@ -1034,7 +1036,7 @@
h
=
Math
.
sqrt
(
x
*
x
+
y
*
y
);
// TODO: ratio should be an option?
ratio
=
(
36
/
radius
>
0.375
?
1.175
-
36
/
radius
:
0.8
)
*
radius
/
h
;
translate
=
__gauge_style
==
'arc'
?
"translate(1,1)"
:
"translate("
+
(
x
*
ratio
)
+
','
+
(
y
*
ratio
)
+
")"
;
translate
=
__gauge_style
==
=
'arc'
?
"translate(1,1)"
:
"translate("
+
(
x
*
ratio
)
+
','
+
(
y
*
ratio
)
+
")"
;
}
return
translate
;
}
...
...
@@ -1089,13 +1091,13 @@
}
function
shouldShowArcLable
()
{
if
(
hasGaugeType
(
c3
.
data
.
targets
))
{
return
true
;
return
true
;
}
return
hasDonutType
(
c3
.
data
.
targets
)
?
__donut_label_show
:
__pie_label_show
;
}
function
getArcLabelFormat
()
{
if
(
hasGaugeType
(
c3
.
data
.
targets
))
{
return
__gauge_label_format
;
return
__gauge_label_format
;
}
return
hasDonutType
(
c3
.
data
.
targets
)
?
__donut_label_format
:
__pie_label_format
;
}
...
...
@@ -1104,21 +1106,21 @@
}
function
getArcOnClick
()
{
if
(
hasGaugeType
(
c3
.
data
.
targets
))
{
return
typeof
__gauge_onclick
===
'function'
?
__gauge_onclick
:
function
()
{};
return
typeof
__gauge_onclick
===
'function'
?
__gauge_onclick
:
function
()
{};
}
var
callback
=
hasDonutType
(
c3
.
data
.
targets
)
?
__donut_onclick
:
__pie_onclick
;
return
typeof
callback
===
'function'
?
callback
:
function
()
{};
}
function
getArcOnMouseOver
()
{
if
(
hasGaugeType
(
c3
.
data
.
targets
))
{
return
typeof
__gauge_onmouseover
===
'function'
?
__gauge_onmouseover
:
function
()
{};
return
typeof
__gauge_onmouseover
===
'function'
?
__gauge_onmouseover
:
function
()
{};
}
var
callback
=
hasDonutType
(
c3
.
data
.
targets
)
?
__donut_onmouseover
:
__pie_onmouseover
;
return
typeof
callback
===
'function'
?
callback
:
function
()
{};
}
function
getArcOnMouseOut
()
{
if
(
hasGaugeType
(
c3
.
data
.
targets
))
{
return
typeof
__gauge_onmouseout
===
'function'
?
__gauge_onmouseout
:
function
()
{};
return
typeof
__gauge_onmouseout
===
'function'
?
__gauge_onmouseout
:
function
()
{};
}
var
callback
=
hasDonutType
(
c3
.
data
.
targets
)
?
__donut_onmouseout
:
__pie_onmouseout
;
return
typeof
callback
===
'function'
?
callback
:
function
()
{};
...
...
@@ -1228,7 +1230,7 @@
padding_bottom
=
yDomainMin
;
}
if
(
!
hasNegativeValueInTargets
(
yTargets
))
{
padding_bottom
-=
padding_bottom
;
padding_bottom
-=
padding_bottom
;
}
return
[
yDomainMin
-
padding_bottom
,
yDomainMax
+
padding_top
];
}
...
...
@@ -1957,9 +1959,9 @@
function
circleX
(
d
)
{
return
d
.
x
||
d
.
x
===
0
?
x
(
d
.
x
)
:
null
;
}
function
circleY
(
d
,
i
)
{
function
circleY
(
d
,
i
)
{
var
lineIndices
=
getLineIndices
(),
getPoint
=
generateGetLinePoint
(
lineIndices
);
if
(
__data_groups
.
length
>
0
)
{
var
point
=
getPoint
(
d
,
i
);
return
point
[
0
][
1
];
}
if
(
__data_groups
.
length
>
0
)
{
var
point
=
getPoint
(
d
,
i
);
return
point
[
0
][
1
];
}
return
getYScale
(
d
.
id
)(
d
.
value
);
}
...
...
@@ -2249,20 +2251,20 @@
}
function
generateLevelColor
(
_colors
,
_values
)
{
var
colors
=
_colors
,
levels
=
_values
;
var
colors
=
_colors
,
levels
=
_values
;
return
function
(
value
)
{
for
(
var
a
=
1
;
a
<
levels
.
length
;
a
++
)
{
if
(
levels
[
0
]
===
'percentage'
&&
((
value
/
__gauge_max
)
*
100
)
<
levels
[
a
])
{
return
colors
[
a
-
1
];
}
if
(
levels
[
0
]
===
'whole'
&&
value
<
levels
[
a
])
{
return
colors
[
a
-
1
];
}
}
return
colors
[
colors
.
length
-
1
];
};
return
function
(
value
)
{
for
(
var
a
=
1
;
a
<
levels
.
length
;
a
++
)
{
if
(
levels
[
0
]
===
'percentage'
&&
((
value
/
__gauge_max
)
*
100
)
<
levels
[
a
])
{
return
colors
[
a
-
1
];
}
if
(
levels
[
0
]
===
'whole'
&&
value
<
levels
[
a
])
{
return
colors
[
a
-
1
];
}
}
return
colors
[
colors
.
length
-
1
];
};
}
//-- Date --//
...
...
@@ -2491,8 +2493,8 @@
return
line
(
data
);
}
}
else
if
(
isStepType
(
d
))
{
line
.
interpolate
(
"step-after"
);
return
line
(
data
);
line
.
interpolate
(
"step-after"
);
return
line
(
data
);
}
else
{
if
(
data
[
0
])
{
x0
=
x
(
data
[
0
].
x
);
...
...
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