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
9d1b32a7
Commit
9d1b32a7
authored
Aug 30, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce grid.lines.front option - #462
parent
b90685c7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
8 deletions
+34
-8
c3.js
c3.js
+14
-3
c3.min.js
c3.min.js
+0
-0
grid_x_lines.html
htdocs/samples/grid_x_lines.html
+6
-2
class.js
src/class.js
+1
-0
config.js
src/config.js
+1
-0
core.js
src/core.js
+3
-0
grid.js
src/grid.js
+9
-3
No files found.
c3.js
View file @
9d1b32a7
...
...
@@ -224,6 +224,9 @@
.
attr
(
"clip-path"
,
$$
.
clipPath
)
.
attr
(
'class'
,
CLASS
.
chart
);
// Grid lines
if
(
config
.
grid_lines_front
)
{
$$
.
initGridLines
();
}
// Cover whole with rects for events
$$
.
initEventRect
();
...
...
@@ -982,6 +985,7 @@
grid_y_lines
:
[],
grid_y_ticks
:
10
,
grid_focus_show
:
true
,
grid_lines_front
:
true
,
// point - point of each data
point_show
:
true
,
point_r
:
2.5
,
...
...
@@ -3051,8 +3055,6 @@
if
(
config
.
grid_y_show
)
{
$$
.
grid
.
append
(
'g'
).
attr
(
'class'
,
CLASS
.
ygrids
);
}
$$
.
grid
.
append
(
'g'
).
attr
(
"class"
,
CLASS
.
xgridLines
);
$$
.
grid
.
append
(
'g'
).
attr
(
'class'
,
CLASS
.
ygridLines
);
if
(
config
.
grid_focus_show
)
{
$$
.
grid
.
append
(
'g'
)
.
attr
(
"class"
,
CLASS
.
xgridFocus
)
...
...
@@ -3060,9 +3062,17 @@
.
attr
(
'class'
,
CLASS
.
xgridFocus
);
}
$$
.
xgrid
=
d3
.
selectAll
([]);
if
(
!
config
.
grid_lines_front
)
{
$$
.
initGridLines
();
}
};
c3_chart_internal_fn
.
initGridLines
=
function
()
{
var
$$
=
this
,
d3
=
$$
.
d3
;
$$
.
gridLines
=
$$
.
main
.
append
(
'g'
)
.
attr
(
"clip-path"
,
$$
.
clipPath
)
.
attr
(
'class'
,
CLASS
.
grid
+
' '
+
CLASS
.
gridLines
);
$$
.
gridLines
.
append
(
'g'
).
attr
(
"class"
,
CLASS
.
xgridLines
);
$$
.
gridLines
.
append
(
'g'
).
attr
(
'class'
,
CLASS
.
ygridLines
);
$$
.
xgridLines
=
d3
.
selectAll
([]);
};
c3_chart_internal_fn
.
updateXGrid
=
function
(
withoutUpdate
)
{
var
$$
=
this
,
config
=
$$
.
config
,
d3
=
$$
.
d3
,
xgridData
=
$$
.
generateGridData
(
config
.
grid_x_type
,
$$
.
x
),
...
...
@@ -5035,6 +5045,7 @@
texts
:
'c3-texts'
,
gaugeValue
:
'c3-gauge-value'
,
grid
:
'c3-grid'
,
gridLines
:
'c3-grid-lines'
,
xgrid
:
'c3-xgrid'
,
xgrids
:
'c3-xgrids'
,
xgridLine
:
'c3-xgrid-line'
,
...
...
c3.min.js
View file @
9d1b32a7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/samples/grid_x_lines.html
View file @
9d1b32a7
...
...
@@ -15,7 +15,8 @@
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
]
]
],
type
:
'bar'
},
grid
:
{
x
:
{
...
...
@@ -39,7 +40,7 @@
columns
:
[
[
'x'
,
'2013-01-01'
,
'2013-01-02'
,
'2013-01-03'
,
'2013-01-04'
,
'2013-01-05'
],
[
'sample'
,
30
,
200
,
100
,
400
,
150
]
]
]
,
},
axis
:
{
x
:
{
...
...
@@ -53,6 +54,9 @@
text
:
'2013/01/04'
,
class
:
'lineFor20130104'
}]
},
lines
:
{
front
:
false
}
}
});
...
...
src/class.js
View file @
9d1b32a7
...
...
@@ -44,6 +44,7 @@ var CLASS = c3_chart_internal_fn.CLASS = {
texts
:
'c3-texts'
,
gaugeValue
:
'c3-gauge-value'
,
grid
:
'c3-grid'
,
gridLines
:
'c3-grid-lines'
,
xgrid
:
'c3-xgrid'
,
xgrids
:
'c3-xgrids'
,
xgridLine
:
'c3-xgrid-line'
,
...
...
src/config.js
View file @
9d1b32a7
...
...
@@ -121,6 +121,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
grid_y_lines
:
[],
grid_y_ticks
:
10
,
grid_focus_show
:
true
,
grid_lines_front
:
true
,
// point - point of each data
point_show
:
true
,
point_r
:
2.5
,
...
...
src/core.js
View file @
9d1b32a7
...
...
@@ -219,6 +219,9 @@ c3_chart_internal_fn.initWithData = function (data) {
.
attr
(
"clip-path"
,
$$
.
clipPath
)
.
attr
(
'class'
,
CLASS
.
chart
);
// Grid lines
if
(
config
.
grid_lines_front
)
{
$$
.
initGridLines
();
}
// Cover whole with rects for events
$$
.
initEventRect
();
...
...
src/grid.js
View file @
9d1b32a7
...
...
@@ -9,8 +9,6 @@ c3_chart_internal_fn.initGrid = function () {
if
(
config
.
grid_y_show
)
{
$$
.
grid
.
append
(
'g'
).
attr
(
'class'
,
CLASS
.
ygrids
);
}
$$
.
grid
.
append
(
'g'
).
attr
(
"class"
,
CLASS
.
xgridLines
);
$$
.
grid
.
append
(
'g'
).
attr
(
'class'
,
CLASS
.
ygridLines
);
if
(
config
.
grid_focus_show
)
{
$$
.
grid
.
append
(
'g'
)
.
attr
(
"class"
,
CLASS
.
xgridFocus
)
...
...
@@ -18,9 +16,17 @@ c3_chart_internal_fn.initGrid = function () {
.
attr
(
'class'
,
CLASS
.
xgridFocus
);
}
$$
.
xgrid
=
d3
.
selectAll
([]);
if
(
!
config
.
grid_lines_front
)
{
$$
.
initGridLines
();
}
};
c3_chart_internal_fn
.
initGridLines
=
function
()
{
var
$$
=
this
,
d3
=
$$
.
d3
;
$$
.
gridLines
=
$$
.
main
.
append
(
'g'
)
.
attr
(
"clip-path"
,
$$
.
clipPath
)
.
attr
(
'class'
,
CLASS
.
grid
+
' '
+
CLASS
.
gridLines
);
$$
.
gridLines
.
append
(
'g'
).
attr
(
"class"
,
CLASS
.
xgridLines
);
$$
.
gridLines
.
append
(
'g'
).
attr
(
'class'
,
CLASS
.
ygridLines
);
$$
.
xgridLines
=
d3
.
selectAll
([]);
};
c3_chart_internal_fn
.
updateXGrid
=
function
(
withoutUpdate
)
{
var
$$
=
this
,
config
=
$$
.
config
,
d3
=
$$
.
d3
,
xgridData
=
$$
.
generateGridData
(
config
.
grid_x_type
,
$$
.
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