Created
June 9, 2015 15:00
-
-
Save biovisualize/47b1586beed6e23d3a2a to your computer and use it in GitHub Desktop.
Cirrus.js code embed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
container: '.container', | |
width: 'auto', | |
height: 'auto', | |
margin: {top: 50, right: 60, bottom: 70, left: 60}, | |
type: 'bar', | |
subtype: 'stacked', | |
labelFormatterX: function(d){ | |
return d3.time.format('%e %b')(new Date(d)); | |
}, | |
tooltipFormatter: function(d){ | |
return d.parentData.name + ' : ' + d.value; | |
}, | |
axisXAngle: 0, | |
tickSize: 10, | |
minorTickSize: 5, | |
fringeSize: 3, | |
tickYCount: 5, | |
axisXTickSkip: 4, | |
gutterPercent: 10, | |
renderer: 'svg', | |
scaleType: 'time', | |
keyX: 'x', | |
keyY: 'y', | |
outerPadding: 'auto', | |
showFringe: true, | |
showAxes: true, | |
showXGrid: true, | |
showYGrid: true, | |
showLegend: true, | |
autoTypeThreshold: 30, | |
chartTitle: 'Chart title', | |
axisXTitle: 'Axis X title', | |
axisYTitle: 'Axis Y title', | |
colorList: ['skyblue', 'orange', 'lime', 'orangered', 'violet'] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = [ | |
{name: 'Sensor1', values: [ | |
{x: 'Fri May 01 2015 13:00:00 GMT-0400 (EDT)', y: 1}, | |
{x: 'Sat May 02 2015 13:00:00 GMT-0400 (EDT)', y: 2}, | |
{x: 'Mon May 04 2015 13:00:00 GMT-0400 (EDT)', y: 3}, | |
{x: 'Tue May 05 2015 13:00:00 GMT-0400 (EDT)', y: 8} | |
]}, | |
{name: 'Sensor2', values: [ | |
{x: 'Fri May 01 2015 13:00:00 GMT-0400 (EDT)', y: 1}, | |
{x: 'Sat May 02 2015 13:00:00 GMT-0400 (EDT)', y: 2}, | |
{x: 'Mon May 04 2015 13:00:00 GMT-0400 (EDT)', y: 3}, | |
{x: 'Tue May 05 2015 13:00:00 GMT-0400 (EDT)', y: 8} | |
]} | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cirrus.init({container: '.container'}).render(data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment