|
|
|
@ -5,6 +5,13 @@
|
|
|
|
|
<body> |
|
|
|
|
<div id="chart1"></div> |
|
|
|
|
<div id="chart2"></div> |
|
|
|
|
<div id="chart3"></div> |
|
|
|
|
<div id="chart4"></div> |
|
|
|
|
<div id="chart5"></div> |
|
|
|
|
<div id="chart6"></div> |
|
|
|
|
<div id="chart7"></div> |
|
|
|
|
<div id="chart8"></div> |
|
|
|
|
<div id="chart9" style="width:33%;"></div> |
|
|
|
|
|
|
|
|
|
<script src="/js/d3.min.js" charset="utf-8"></script> |
|
|
|
|
<script src="/js/c3.js"></script> |
|
|
|
@ -12,6 +19,123 @@
|
|
|
|
|
|
|
|
|
|
var chart1 = c3.generate({ |
|
|
|
|
bindto: '#chart1', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', 190, 200, 190, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
|
format: function (v, id) { |
|
|
|
|
if (v === null) { |
|
|
|
|
return 'Not Applicable'; |
|
|
|
|
} |
|
|
|
|
return d3.format('$')(v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart2 = c3.generate({ |
|
|
|
|
bindto: '#chart2', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', -190, -200, -190, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
|
format: function (v, id) { |
|
|
|
|
if (v === null) { |
|
|
|
|
return 'Not Applicable'; |
|
|
|
|
} |
|
|
|
|
return d3.format('$')(v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart3 = c3.generate({ |
|
|
|
|
bindto: '#chart3', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', -190, 200, 190, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
|
format: function (v, id) { |
|
|
|
|
if (v === null) { |
|
|
|
|
return 'Not Applicable'; |
|
|
|
|
} |
|
|
|
|
return d3.format('$')(v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart4 = c3.generate({ |
|
|
|
|
bindto: '#chart4', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', 190, 200, 190, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
|
format: function (v, id) { |
|
|
|
|
if (v === null) { |
|
|
|
|
return 'Not Applicable'; |
|
|
|
|
} |
|
|
|
|
return d3.format('$')(v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
axis: { |
|
|
|
|
rotated: true |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart5 = c3.generate({ |
|
|
|
|
bindto: '#chart5', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', -190, -200, -190, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
|
format: function (v, id) { |
|
|
|
|
if (v === null) { |
|
|
|
|
return 'Not Applicable'; |
|
|
|
|
} |
|
|
|
|
return d3.format('$')(v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
axis: { |
|
|
|
|
rotated: true |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart6 = c3.generate({ |
|
|
|
|
bindto: '#chart6', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', -190, 200, 190, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
|
format: function (v, id) { |
|
|
|
|
if (v === null) { |
|
|
|
|
return 'Not Applicable'; |
|
|
|
|
} |
|
|
|
|
return d3.format('$')(v); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
axis: { |
|
|
|
|
rotated: true |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart7 = c3.generate({ |
|
|
|
|
bindto: '#chart7', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', 30, 200, 100, 500, 150, 250], |
|
|
|
@ -27,13 +151,28 @@
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart2 = c3.generate({ |
|
|
|
|
bindto: '#chart2', |
|
|
|
|
var chart8 = c3.generate({ |
|
|
|
|
bindto: '#chart8', |
|
|
|
|
data: { |
|
|
|
|
x: 'x', |
|
|
|
|
columns: [ |
|
|
|
|
['x', '2014-01-01', '2014-02-01', '2014-03-01', '2014-04-01'], |
|
|
|
|
['data1', -190, 200, 190, null], |
|
|
|
|
['data1', -30, -200, -100, -500, -150, -250], |
|
|
|
|
['data2', -50, -20, -10, -40, -15, -25], |
|
|
|
|
['data3', -250, -220, -210, -240, -215, -225] |
|
|
|
|
], |
|
|
|
|
groups: [['data1', 'data2', 'data3']], |
|
|
|
|
labels: true, |
|
|
|
|
type: 'bar', |
|
|
|
|
}, |
|
|
|
|
axis: { |
|
|
|
|
rotated: true |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var chart9 = c3.generate({ |
|
|
|
|
bindto: '#chart9', |
|
|
|
|
data: { |
|
|
|
|
columns: [ |
|
|
|
|
['data1', -19000000000000, 200, 19000000000000, null], |
|
|
|
|
], |
|
|
|
|
type: 'bar', |
|
|
|
|
labels: { |
|
|
|
@ -46,10 +185,8 @@
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
axis: { |
|
|
|
|
x: { |
|
|
|
|
type: 'categorized' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rotated: true |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|