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
e44ce25b
Commit
e44ce25b
authored
Apr 02, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix clipId to unique for each chart - #109 #110
parent
543d9ebf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
c3.js
c3.js
+12
-8
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
e44ce25b
...
@@ -259,7 +259,11 @@
...
@@ -259,7 +259,11 @@
/*-- Set Variables --*/
/*-- Set Variables --*/
var
clipId
=
(
typeof
__bindto
===
"string"
?
__bindto
.
replace
(
'#'
,
''
)
:
__bindto
.
id
)
+
'-clip'
,
var
clipId
=
(
typeof
__bindto
===
"string"
?
__bindto
.
replace
(
'#'
,
''
)
:
__bindto
.
id
)
+
'-clip'
,
clipPath
=
getClipPath
(
clipId
);
clipIdForXAxis
=
clipId
+
'-xaxis'
,
clipIdForYAxis
=
clipId
+
'-yaxis'
,
clipPath
=
getClipPath
(
clipId
),
clipPathForXAxis
=
getClipPath
(
clipPathForXAxis
),
clipPathForYAxis
=
getClipPath
(
clipPathForYAxis
);
var
isTimeSeries
=
(
__axis_x_type
===
'timeseries'
),
var
isTimeSeries
=
(
__axis_x_type
===
'timeseries'
),
isCategorized
=
(
__axis_x_type
===
'categorized'
),
isCategorized
=
(
__axis_x_type
===
'categorized'
),
...
@@ -2308,14 +2312,14 @@
...
@@ -2308,14 +2312,14 @@
.
attr
(
"width"
,
width
)
.
attr
(
"width"
,
width
)
.
attr
(
"height"
,
height
);
.
attr
(
"height"
,
height
);
defs
.
append
(
"clipPath"
)
defs
.
append
(
"clipPath"
)
.
attr
(
"id"
,
"xaxis-clip"
)
.
attr
(
"id"
,
clipIdForXAxis
)
.
append
(
"rect"
)
.
append
(
"rect"
)
.
attr
(
"x"
,
getXAxisClipX
)
.
attr
(
"x"
,
getXAxisClipX
)
.
attr
(
"y"
,
getXAxisClipY
)
.
attr
(
"y"
,
getXAxisClipY
)
.
attr
(
"width"
,
getXAxisClipWidth
)
.
attr
(
"width"
,
getXAxisClipWidth
)
.
attr
(
"height"
,
getXAxisClipHeight
);
.
attr
(
"height"
,
getXAxisClipHeight
);
defs
.
append
(
"clipPath"
)
defs
.
append
(
"clipPath"
)
.
attr
(
"id"
,
"yaxis-clip"
)
.
attr
(
"id"
,
clipIdForYAxis
)
.
append
(
"rect"
)
.
append
(
"rect"
)
.
attr
(
"x"
,
getYAxisClipX
)
.
attr
(
"x"
,
getYAxisClipX
)
.
attr
(
"y"
,
getYAxisClipY
)
.
attr
(
"y"
,
getYAxisClipY
)
...
@@ -2341,7 +2345,7 @@
...
@@ -2341,7 +2345,7 @@
// Add Axis
// Add Axis
main
.
append
(
"g"
)
main
.
append
(
"g"
)
.
attr
(
"class"
,
CLASS
.
axisX
)
.
attr
(
"class"
,
CLASS
.
axisX
)
.
attr
(
"clip-path"
,
__axis_rotated
?
""
:
getClipPath
(
"xaxis-clip"
)
)
.
attr
(
"clip-path"
,
__axis_rotated
?
""
:
clipPathForXAxis
)
.
attr
(
"transform"
,
translate
.
x
)
.
attr
(
"transform"
,
translate
.
x
)
.
append
(
"text"
)
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
axisXLabel
)
.
attr
(
"class"
,
CLASS
.
axisXLabel
)
...
@@ -2353,7 +2357,7 @@
...
@@ -2353,7 +2357,7 @@
if
(
__axis_y_show
)
{
if
(
__axis_y_show
)
{
main
.
append
(
"g"
)
main
.
append
(
"g"
)
.
attr
(
"class"
,
CLASS
.
axisY
)
.
attr
(
"class"
,
CLASS
.
axisY
)
.
attr
(
"clip-path"
,
__axis_rotated
?
getClipPath
(
"yaxis-clip"
)
:
""
)
.
attr
(
"clip-path"
,
__axis_rotated
?
clipPathForYAxis
:
""
)
.
append
(
"text"
)
.
append
(
"text"
)
.
attr
(
"class"
,
CLASS
.
axisYLabel
)
.
attr
(
"class"
,
CLASS
.
axisYLabel
)
.
attr
(
"transform"
,
__axis_rotated
?
""
:
"rotate(-90)"
)
.
attr
(
"transform"
,
__axis_rotated
?
""
:
"rotate(-90)"
)
...
@@ -2486,7 +2490,7 @@
...
@@ -2486,7 +2490,7 @@
context
.
append
(
"g"
)
context
.
append
(
"g"
)
.
attr
(
"class"
,
CLASS
.
axisX
)
.
attr
(
"class"
,
CLASS
.
axisX
)
.
attr
(
"transform"
,
translate
.
subx
)
.
attr
(
"transform"
,
translate
.
subx
)
.
attr
(
"clip-path"
,
__axis_rotated
?
""
:
getClipPath
(
"xaxis-clip"
)
);
.
attr
(
"clip-path"
,
__axis_rotated
?
""
:
clipPathForXAxis
);
}
}
// Set targets
// Set targets
...
@@ -3250,8 +3254,8 @@
...
@@ -3250,8 +3254,8 @@
function
updateSvgSize
()
{
function
updateSvgSize
()
{
svg
.
attr
(
'width'
,
currentWidth
).
attr
(
'height'
,
currentHeight
);
svg
.
attr
(
'width'
,
currentWidth
).
attr
(
'height'
,
currentHeight
);
svg
.
select
(
'#'
+
clipId
).
select
(
'rect'
).
attr
(
'width'
,
width
).
attr
(
'height'
,
height
);
svg
.
select
(
'#'
+
clipId
).
select
(
'rect'
).
attr
(
'width'
,
width
).
attr
(
'height'
,
height
);
svg
.
select
(
'#
xaxis-clip'
).
select
(
'rect'
).
attr
(
'width'
,
getXAxisClipWidth
);
svg
.
select
(
'#
'
+
clipIdForXAxis
).
select
(
'rect'
).
attr
(
'width'
,
getXAxisClipWidth
);
svg
.
select
(
'#
yaxis-clip'
).
select
(
'rect'
).
attr
(
'width'
,
getYAxisClipWidth
);
svg
.
select
(
'#
'
+
clipIdForYAxis
).
select
(
'rect'
).
attr
(
'width'
,
getYAxisClipWidth
);
svg
.
select
(
'.'
+
CLASS
.
zoomRect
).
attr
(
'width'
,
width
).
attr
(
'height'
,
height
);
svg
.
select
(
'.'
+
CLASS
.
zoomRect
).
attr
(
'width'
,
width
).
attr
(
'height'
,
height
);
}
}
...
...
c3.min.js
View file @
e44ce25b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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