mirror of https://github.com/masayuki0812/c3.git
Browse Source
Added uncorrect removed files. Fixed build files permissions. Fixed visibility property spelling. Fixed bug on returned zoom domain in 'onzoomend' event. Prevent a drag from a single click. removed fix for false click. Fixed bug in update zoom when zoom type is drag.pull/2447/head
Tiago Costa
9 years ago
committed by
Yoshiya Hinosawa
9 changed files with 175 additions and 0 deletions
@ -0,0 +1,62 @@
|
||||
<html> |
||||
<head> |
||||
<link rel="stylesheet" type="text/css" href="/css/c3.css"> |
||||
</head> |
||||
<body> |
||||
<p>Zoom Type Scroll with Default Zoom Behavior</p> |
||||
<div id="chart1"></div> |
||||
|
||||
<p>Zoom Type Drag with Default Zoom Behavior</p> |
||||
<div id="chart2"></div> |
||||
|
||||
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> |
||||
<script src="/js/c3.js"></script> |
||||
<script> |
||||
|
||||
var chart1 = c3.generate({ |
||||
bindto: '#chart1', |
||||
data: { |
||||
columns: [ |
||||
generateData(100) |
||||
] |
||||
}, |
||||
zoom: { |
||||
enabled: true, |
||||
type: 'scroll', |
||||
disableDefaultBehavior: false |
||||
} |
||||
}); |
||||
|
||||
var chart2 = c3.generate({ |
||||
bindto: '#chart2', |
||||
data: { |
||||
columns: [ |
||||
generateData(100) |
||||
] |
||||
}, |
||||
zoom: { |
||||
enabled: true, |
||||
type: 'drag', |
||||
disableDefaultBehavior: false |
||||
} |
||||
}); |
||||
|
||||
function load() { |
||||
chart1.load({ |
||||
columns: [ |
||||
generateData(Math.random() * 1000) |
||||
] |
||||
}); |
||||
} |
||||
|
||||
function generateData(n) { |
||||
var column = ['sample']; |
||||
for (var i = 0; i < n; i++) { |
||||
column.push(Math.random() * 500); |
||||
} |
||||
return column; |
||||
} |
||||
|
||||
</script> |
||||
</body> |
||||
</html> |
@ -0,0 +1,13 @@
|
||||
.c3-drag-zoom.enabled{ |
||||
pointer-events: all!important; |
||||
visibility: visible; |
||||
} |
||||
|
||||
.c3-drag-zoom.disabled{ |
||||
pointer-events: none!important; |
||||
visibility: hidden; |
||||
} |
||||
|
||||
.c3-drag-zoom .extent { |
||||
fill-opacity: .1; |
||||
} |
Loading…
Reference in new issue