1
我最初製作了一個包含數據的圖表,但是如果數據在載入函數的圖表中不可用,它不會顯示沒有可用數據的字符串。如何在c3 JS圖表的加載函數中顯示沒有數據
var chart = c3.generate({
bindto: '#chart1',
data: {
columns: [
['data1', -30, 200, 200, 400, -150, 250],
['data2', 130, 100, -100, 200, -150, 50]
],
type: 'bar',
groups: [
['data1', 'data2']
],
empty: { label: { text: "No Data Available" } }
},
grid: {
y: {
lines: [{value:0}]
}
}
});
setTimeout(function() {
chart.load({
columns: [
],
empty: { label: { text: "No Data Available" } }
});
chart.flush();
}, 1500);
<link href="https://rawgit.com/masayuki0812/c3/master/c3.css" rel="stylesheet"/>
<script src="https://rawgit.com/masayuki0812/c3/master/c3.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.4.11/d3.min.js"></script>
<div id="chart1"></div>
如何顯示無負載功能提供數據?
工作就像一個魅力。謝謝 :) – Raichu