Built with blockbuilder.org
Created
November 16, 2019 22:01
-
-
Save jwilber/ee35865631cb805057142568fa5fd090 to your computer and use it in GitHub Desktop.
roughViz StackedBar Demo
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
license: mit |
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
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://unpkg.com/rough-viz@1.0.5"></script> | |
<style> | |
.wrapper { | |
display: flex; | |
flex: wrap; | |
order: row; | |
} | |
</style> | |
</head> | |
<body> | |
<br><br> | |
<div class="wrapper"> | |
<div id="vis0"></div> | |
</div> | |
<script> | |
new roughViz.StackedBar({ | |
element: '#vis0', | |
data: [ | |
{month:'Jan', A:20, B: 5, C: 10}, | |
{month:'Feb', A:25, B: 10, C: 20}, | |
{month:'March', A:30, B:50, C:10} | |
], | |
labels: 'month', | |
title: 'Monthly Revenue', | |
height: window.innerHeight * 0.7, | |
width: window.innerWidth * 0.8, | |
roughness: 2, | |
colors: [ | |
'blue', | |
'#f996ae', | |
'skyblue', | |
'#9ff4df', | |
], | |
fillWeight: 0.35, | |
strokeWidth: 0.5, | |
fillStyle: 'cross-hatch', | |
stroke: 'black', | |
}); | |
</script> | |
</body> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment