Browse Source

Fix legend position when element appended - #334

pull/340/head
Masayuki Tanaka 10 years ago
parent
commit
169da6264a
  1. 2
      c3.js
  2. 2
      c3.min.js
  3. 27
      htdocs/samples/element.html

2
c3.js

@ -2956,7 +2956,7 @@
// MEMO: call here to update legend box and tranlate for all
// MEMO: translate will be upated by this, so transform not needed in updateLegend()
updateLegend(mapToIds(c3.data.targets), {withTransform: false, withTransitionForTransform: false});
updateLegend(mapToIds(c3.data.targets), {withTransform: false, withTransitionForTransform: false, withTransition: false});
/*-- Main Region --*/

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

27
htdocs/samples/element.html

@ -3,26 +3,35 @@
<link rel="stylesheet" type="text/css" href="/css/c3.css">
</head>
<body>
<!-- <div id="chart"></div>-->
<div id="chart1"></div>
<div id="chart2"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="/js/c3.js"></script>
<script>
var chart = c3.generate({
var chart1 = c3.generate({
data: {
columns: [
['sample', 30, 200, 100, null, 150, 250]
],
},
// size: {
// width: 640,
// height: 320
// }
});
setTimeout(function () {
document.body.appendChild(chart.element);
}, 1000);
var chart2 = c3.generate({
data: {
columns: [
['sample', 30, 200, 100, null, 150, 250]
],
type: 'bar'
}
});
document.getElementById('chart1').appendChild(chart1.element);
$('#chart2').append(chart2.element);
</script>
</body>
</html>

Loading…
Cancel
Save