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
951a78ac
Commit
951a78ac
authored
Mar 31, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix x/xs API
parent
bd02e0f1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
c3.js
c3.js
+6
-2
c3.min.js
c3.min.js
+0
-0
custom_xs_scale.html
htdocs/samples/custom_xs_scale.html
+3
-3
No files found.
c3.js
View file @
951a78ac
...
...
@@ -1237,7 +1237,7 @@
function
updateTargetX
(
targets
,
x
)
{
targets
.
forEach
(
function
(
t
)
{
t
.
values
.
f
ilter
(
function
(
v
)
{
return
v
.
value
!==
null
;
}).
f
orEach
(
function
(
v
,
i
)
{
t
.
values
.
forEach
(
function
(
v
,
i
)
{
v
.
x
=
generateTargetX
(
x
[
i
],
t
.
id
,
i
);
});
c3
.
data
.
x
[
t
.
id
]
=
x
;
...
...
@@ -1328,8 +1328,12 @@
if
(
i
===
0
)
{
__axis_x_categories
=
[];
}
__axis_x_categories
.
push
(
rawX
);
}
// mark as x = undefined if value is undefined and filter to remove after mapped
if
(
typeof
d
[
id
]
===
'undefined'
)
{
x
=
undefined
;
}
return
{
x
:
x
,
value
:
d
[
id
]
!==
null
&&
!
isNaN
(
d
[
id
])
?
+
d
[
id
]
:
null
,
id
:
convertedId
};
})
})
.
filter
(
function
(
v
)
{
return
typeof
v
.
x
!==
'undefined'
;
})
};
});
...
...
c3.min.js
View file @
951a78ac
This diff is collapsed.
Click to expand it.
htdocs/samples/custom_xs_scale.html
View file @
951a78ac
...
...
@@ -32,7 +32,7 @@
setTimeout
(
function
()
{
chart
.
load
({
columns
:
[
[
'data1'
,
100
,
210
,
150
,
200
,
100
,
150
],
[
'data1'
,
100
,
210
,
150
,
200
,
null
,
150
],
[
'data2'
,
200
,
310
,
50
,
400
,
120
,
250
,
10
],
]
});
...
...
@@ -40,8 +40,8 @@
setTimeout
(
function
()
{
chart
.
xs
({
// 'data1': [200, 210, 350, 400, 55
0, 750]
'data2'
:
[
200
,
210
,
350
,
400
,
550
,
750
,
900
]
'data1'
:
[
200
,
210
,
350
,
400
,
60
0
,
750
]
//
'data2': [200, 210, 350, 400, 550, 750, 900]
});
},
2000
);
</script>
...
...
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