Skip to content

Instantly share code, notes, and snippets.

@openjck
Last active August 8, 2017 21:29
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 openjck/621505033bc9b22d7d24eb7f48f65062 to your computer and use it in GitHub Desktop.
Save openjck/621505033bc9b22d7d24eb7f48f65062 to your computer and use it in GitHub Desktop.
HTML document demonstrating the issue described in metricsgraphics/metrics-graphics#764
<!doctype html>
<html lang="en-US" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Example</title>
<link href="https://rawgit.com/mozilla/metrics-graphics/4722d8a7aaaea604a942f6b39bd169b9bfa815fb/dist/metricsgraphics.css" rel="stylesheet" />
</head>
<body>
<div id="target"></div>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="https://rawgit.com/mozilla/metrics-graphics/4722d8a7aaaea604a942f6b39bd169b9bfa815fb/dist/metricsgraphics.js"></script>
<script>
const exampleData = [
{ x: 1, y: 1000 },
{ x: 2, y: 2000 },
{ x: 100, y: 3000 },
];
MG.data_graphic({
target: '#target',
data: exampleData,
x_accessor: 'x',
y_accessor: 'y',
y_label: 'Example Y Label',
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment