Skip to content

Instantly share code, notes, and snippets.

@jwilber
Created October 7, 2019 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwilber/a2dccbc103d7667643f35a8c8947a390 to your computer and use it in GitHub Desktop.
Save jwilber/a2dccbc103d7667643f35a8c8947a390 to your computer and use it in GitHub Desktop.
roughViz Pie Demo
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/rough-viz@1.0.4"></script>
<style>
.wrapper {
display: flex;
flex: wrap;
order: row;
}
</style>
</head>
<body>
<br><br>
<div class="wrapper">
<div id="vis0"></div>
<div id="vis1"></div>
</div>
<script>
new roughViz.Pie(
{
element: '#vis0',
titleFontSize: '1.5rem',
margin: {top: 50, bottom: 100, left: 40, right: 100},
data: {
labels: ['yes', 'no', 'lol idk man'],
values: [2, 8, 4]
},
title: "'Yarn Plot': Useful?",
roughness: 25,
strokeWidth: 5,
innerStrokeWidth: 5,
}
);
new roughViz.Pie(
{
element: '#vis1',
titleFontSize: '1.5rem',
legend: false,
margin: {top: 50, bottom: 100, left: 40, right: 100},
data: {
labels: ['useful', 'no', 'lol idk man'],
values: [2, 8, 4]
},
strokeWidth: 3,
fillStyle: 'zigzag-line',
highlight: 'gold',
}
);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment