Skip to content

Instantly share code, notes, and snippets.

@jwilber
Created October 7, 2019 01:51
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/419fa6d878fe6c0f79a28f9fc72d7ec6 to your computer and use it in GitHub Desktop.
Save jwilber/419fa6d878fe6c0f79a28f9fc72d7ec6 to your computer and use it in GitHub Desktop.
roughViz BarH 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.BarH(
{
element: '#vis0',
title: "Vehicles I've Had",
titleFontSize: '1.5rem',
legend: false,
margin: {top: 50, bottom: 100, left: 160, right: 0},
data: {
labels: ['1992 Ford Aerostar Van', '2013 Kia Rio', '1980 Honda CB 125s', '1992 Toyota Tercel'],
values: [8, 4, 6, 2]
},
xLabel: 'Time Owned (Years)',
strokeWidth: 2,
fillStyle: 'zigzag-line',
highlight: 'gold',
}
);
new roughViz.BarH(
{
element: '#vis1',
titleFontSize: '1.5rem',
// margin: {top: 50, bottom: 100, left: 60, right: 0},
data: 'https://raw.githubusercontent.com/jwilber/random_data/master/owTanks.csv',
color: 'tan',
labels: 'name',
values: 'health',
title: "Overwatch Tank Health",
roughness: 4,
}
);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment