Skip to content

Instantly share code, notes, and snippets.

@doc22940
Created April 5, 2020 06:15
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 doc22940/c4d3d1431dd5c4601d3aa3c86e8a5064 to your computer and use it in GitHub Desktop.
Save doc22940/c4d3d1431dd5c4601d3aa3c86e8a5064 to your computer and use it in GitHub Desktop.
roughViz Line Demo
license: mit
<!DOCTYPE html>
<!-- Error1: When no x: attribute explicitly defined, it doesn't know where to position labels.
Error2: Axes not showing for some reason. Maybe I'll just move them to the front-->
<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>
let ttop = 50;
let rright = 20;
let bbottom = 45;
let width = 300;
new roughViz.Line(
{
element: '#vis0',
data: 'https://raw.githubusercontent.com/jwilber/random_data/master/tweets.csv',
title: 'Line Chart',
// x: 'gdpPercap',
y: 'favorites',
y2: 'retweets',
y3: 'tweets',
yLabel: 'hey',
colorVar: 'continent',
highlightLabel: 'country',
highlight: 'red',
fillWeight: 2,
roughness: 3.5,
width: window.innerWidth / 1.2,
height: 500,
}
);
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment