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
d313e586
Commit
d313e586
authored
Jun 03, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug for flow with indexed data
parent
68140c2c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
18 deletions
+26
-18
c3.js
c3.js
+4
-8
c3.min.js
c3.min.js
+0
-0
api_flow.html
htdocs/samples/api_flow.html
+12
-5
api_flow_timeseries.html
htdocs/samples/api_flow_timeseries.html
+10
-5
No files found.
c3.js
View file @
d313e586
...
...
@@ -4053,17 +4053,13 @@
// generate transform to flow
if
(
!
options
.
flow
.
orgDataCount
)
{
// if empty
if
(
isTimeSeries
)
{
if
(
c3
.
data
.
targets
[
0
].
values
.
length
!==
1
)
{
translateX
=
x
(
orgDomain
[
0
])
-
x
(
domain
[
0
]);
}
else
{
if
(
c3
.
data
.
targets
[
0
].
values
.
length
!==
1
)
{
translateX
=
x
(
orgDomain
[
0
])
-
x
(
domain
[
0
]);
}
else
{
if
(
isTimeSeries
)
{
flowStart
=
getValueOnIndex
(
c3
.
data
.
targets
[
0
].
values
,
0
);
flowEnd
=
getValueOnIndex
(
c3
.
data
.
targets
[
0
].
values
,
c3
.
data
.
targets
[
0
].
values
.
length
-
1
);
translateX
=
x
(
flowStart
.
x
)
-
x
(
flowEnd
.
x
);
}
}
else
{
if
(
c3
.
data
.
targets
[
0
].
values
.
length
!==
1
)
{
translateX
=
(
domain
[
0
]
-
orgDomain
[
0
]
>=
1
?
x
(
orgDomain
[
0
])
:
0
)
-
x
(
flowEnd
.
x
);
}
else
{
translateX
=
diffDomain
(
domain
)
/
2
;
}
...
...
c3.min.js
View file @
d313e586
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/samples/api_flow.html
View file @
d313e586
...
...
@@ -15,16 +15,13 @@
<script
src=
"/js/c3.js"
></script>
<script>
var
padding
=
{},
chart
,
generate
=
function
()
{
return
c3
.
generate
({
var
padding
=
{},
types
=
{},
chart
,
generate
=
function
()
{
return
c3
.
generate
({
data
:
{
columns
:
[
[
'data1'
],
[
'data2'
],
],
types
:
{
data2
:
'area'
,
data3
:
'bar'
,
},
types
:
types
,
labels
:
true
},
bar
:
{
...
...
@@ -205,11 +202,21 @@
run
();
// Test for no padding
setTimeout
(
function
()
{
padding
=
{
left
:
0
,
right
:
0
};
run
();
},
22000
);
// Test for other chart types
setTimeout
(
function
()
{
types
=
{
data2
:
'area'
,
data3
:
'bar'
,
};
run
();
},
45000
);
</script>
</body>
</html>
htdocs/samples/api_flow_timeseries.html
View file @
d313e586
...
...
@@ -9,7 +9,7 @@
<script
src=
"/js/c3.js"
></script>
<script>
var
padding
=
{};
var
padding
=
{}
,
types
=
{}
;
var
generate
=
function
()
{
return
c3
.
generate
({
data
:
{
...
...
@@ -23,10 +23,7 @@
// ['data2', 310, 400, 200, 100, 450, 150],
// ['data3', 310, 400, 200, 100, null, 150],
],
types
:
{
data2
:
'area'
,
data3
:
'bar'
,
},
types
:
types
,
// labels: true
},
bar
:
{
...
...
@@ -163,6 +160,14 @@
run
();
},
25000
);
setTimeout
(
function
()
{
types
=
{
data2
:
'area'
,
data3
:
'bar'
,
}
run
();
},
50000
);
</script>
</body>
</html>
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