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
4a624a1f
Commit
4a624a1f
authored
Sep 21, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gauge when resize called - #546
parent
f1e720e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
32 deletions
+44
-32
c3.js
c3.js
+22
-16
c3.min.js
c3.min.js
+0
-0
arc.js
src/arc.js
+22
-16
No files found.
c3.js
View file @
4a624a1f
...
@@ -4481,12 +4481,8 @@
...
@@ -4481,12 +4481,8 @@
main
.
select
(
'.'
+
CLASS
.
chartArcsTitle
)
main
.
select
(
'.'
+
CLASS
.
chartArcsTitle
)
.
style
(
"opacity"
,
$$
.
hasType
(
'donut'
)
||
$$
.
hasType
(
'gauge'
)
?
1
:
0
);
.
style
(
"opacity"
,
$$
.
hasType
(
'donut'
)
||
$$
.
hasType
(
'gauge'
)
?
1
:
0
);
};
c3_chart_internal_fn
.
initGauge
=
function
()
{
var
$$
=
this
,
config
=
$$
.
config
,
arcs
=
$$
.
arcs
;
if
(
$$
.
hasType
(
'gauge'
))
{
if
(
$$
.
hasType
(
'gauge'
))
{
arcs
.
append
(
'path'
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsBackground
)
.
attr
(
"class"
,
CLASS
.
chartArcsBackground
)
.
attr
(
"d"
,
function
()
{
.
attr
(
"d"
,
function
()
{
var
d
=
{
var
d
=
{
data
:
[{
value
:
config
.
gauge_max
}],
data
:
[{
value
:
config
.
gauge_max
}],
...
@@ -4495,26 +4491,36 @@
...
@@ -4495,26 +4491,36 @@
};
};
return
$$
.
getArc
(
d
,
true
,
true
);
return
$$
.
getArc
(
d
,
true
,
true
);
});
});
arcs
.
append
(
"text"
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsGaugeUnit
)
.
attr
(
"dy"
,
".75em"
)
.
attr
(
"dy"
,
".75em"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeUnit
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
)
.
text
(
config
.
gauge_label_show
?
config
.
gauge_units
:
''
);
.
text
(
config
.
gauge_label_show
?
config
.
gauge_units
:
''
);
arcs
.
append
(
"text"
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsGaugeMin
)
.
attr
(
"dx"
,
-
1
*
(
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
))
+
"px"
)
.
attr
(
"dx"
,
-
1
*
(
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
))
+
"px"
)
.
attr
(
"dy"
,
"1.2em"
)
.
attr
(
"dy"
,
"1.2em"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMin
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
)
.
text
(
config
.
gauge_label_show
?
config
.
gauge_min
:
''
);
.
text
(
config
.
gauge_label_show
?
config
.
gauge_min
:
''
);
arcs
.
append
(
"text"
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsGaugeMax
)
.
attr
(
"dx"
,
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
)
+
"px"
)
.
attr
(
"dx"
,
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
)
+
"px"
)
.
attr
(
"dy"
,
"1.2em"
)
.
attr
(
"dy"
,
"1.2em"
)
.
text
(
config
.
gauge_label_show
?
config
.
gauge_max
:
''
);
}
};
c3_chart_internal_fn
.
initGauge
=
function
()
{
var
arcs
=
this
.
arcs
;
if
(
this
.
hasType
(
'gauge'
))
{
arcs
.
append
(
'path'
)
.
attr
(
"class"
,
CLASS
.
chartArcsBackground
);
arcs
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeUnit
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
);
arcs
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMin
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
);
arcs
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMax
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMax
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
)
.
style
(
"pointer-events"
,
"none"
);
.
text
(
config
.
gauge_label_show
?
config
.
gauge_max
:
''
);
}
}
};
};
c3_chart_internal_fn
.
getGaugeLabelHeight
=
function
()
{
c3_chart_internal_fn
.
getGaugeLabelHeight
=
function
()
{
...
...
c3.min.js
View file @
4a624a1f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/arc.js
View file @
4a624a1f
...
@@ -327,12 +327,8 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
...
@@ -327,12 +327,8 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf
main
.
select
(
'.'
+
CLASS
.
chartArcsTitle
)
main
.
select
(
'.'
+
CLASS
.
chartArcsTitle
)
.
style
(
"opacity"
,
$$
.
hasType
(
'donut'
)
||
$$
.
hasType
(
'gauge'
)
?
1
:
0
);
.
style
(
"opacity"
,
$$
.
hasType
(
'donut'
)
||
$$
.
hasType
(
'gauge'
)
?
1
:
0
);
};
c3_chart_internal_fn
.
initGauge
=
function
()
{
var
$$
=
this
,
config
=
$$
.
config
,
arcs
=
$$
.
arcs
;
if
(
$$
.
hasType
(
'gauge'
))
{
if
(
$$
.
hasType
(
'gauge'
))
{
arcs
.
append
(
'path'
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsBackground
)
.
attr
(
"class"
,
CLASS
.
chartArcsBackground
)
.
attr
(
"d"
,
function
()
{
.
attr
(
"d"
,
function
()
{
var
d
=
{
var
d
=
{
data
:
[{
value
:
config
.
gauge_max
}],
data
:
[{
value
:
config
.
gauge_max
}],
...
@@ -341,26 +337,36 @@ c3_chart_internal_fn.initGauge = function () {
...
@@ -341,26 +337,36 @@ c3_chart_internal_fn.initGauge = function () {
};
};
return
$$
.
getArc
(
d
,
true
,
true
);
return
$$
.
getArc
(
d
,
true
,
true
);
});
});
arcs
.
append
(
"text"
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsGaugeUnit
)
.
attr
(
"dy"
,
".75em"
)
.
attr
(
"dy"
,
".75em"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeUnit
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
)
.
text
(
config
.
gauge_label_show
?
config
.
gauge_units
:
''
);
.
text
(
config
.
gauge_label_show
?
config
.
gauge_units
:
''
);
arcs
.
append
(
"text"
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsGaugeMin
)
.
attr
(
"dx"
,
-
1
*
(
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
))
+
"px"
)
.
attr
(
"dx"
,
-
1
*
(
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
))
+
"px"
)
.
attr
(
"dy"
,
"1.2em"
)
.
attr
(
"dy"
,
"1.2em"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMin
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
)
.
text
(
config
.
gauge_label_show
?
config
.
gauge_min
:
''
);
.
text
(
config
.
gauge_label_show
?
config
.
gauge_min
:
''
);
arcs
.
append
(
"text"
)
$$
.
arcs
.
select
(
'.'
+
CLASS
.
chartArcsGaugeMax
)
.
attr
(
"dx"
,
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
)
+
"px"
)
.
attr
(
"dx"
,
$$
.
innerRadius
+
((
$$
.
radius
-
$$
.
innerRadius
)
/
2
)
+
"px"
)
.
attr
(
"dy"
,
"1.2em"
)
.
attr
(
"dy"
,
"1.2em"
)
.
text
(
config
.
gauge_label_show
?
config
.
gauge_max
:
''
);
}
};
c3_chart_internal_fn
.
initGauge
=
function
()
{
var
arcs
=
this
.
arcs
;
if
(
this
.
hasType
(
'gauge'
))
{
arcs
.
append
(
'path'
)
.
attr
(
"class"
,
CLASS
.
chartArcsBackground
);
arcs
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeUnit
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
);
arcs
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMin
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
);
arcs
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMax
)
.
attr
(
"class"
,
CLASS
.
chartArcsGaugeMax
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"text-anchor"
,
"middle"
)
.
style
(
"pointer-events"
,
"none"
)
.
style
(
"pointer-events"
,
"none"
);
.
text
(
config
.
gauge_label_show
?
config
.
gauge_max
:
''
);
}
}
};
};
c3_chart_internal_fn
.
getGaugeLabelHeight
=
function
()
{
c3_chart_internal_fn
.
getGaugeLabelHeight
=
function
()
{
...
...
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