Skip to content

Instantly share code, notes, and snippets.

@ZucchiniZe
Created April 10, 2015 23:16
Show Gist options
  • Select an option

  • Save ZucchiniZe/30d10d8ea97f3cf8de43 to your computer and use it in GitHub Desktop.

Select an option

Save ZucchiniZe/30d10d8ea97f3cf8de43 to your computer and use it in GitHub Desktop.
DNA Barcoding Infographic
<!DOCTYPE html>
<html>
<head>
<title>Chart</title>
<script src="http://cdn.smtcs.rocks/jq/2.js"></script>
<script src="http://cdn.smtcs.rocks/md/md.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
</head>
<body>
<div class="legend">
<ul class="bar-legend">
<li><span style="background-color:rgba(255,0,0,1)">A42</span></li>
<li><span style="background-color:rgba(0,255,0,1)">G42</span></li>
<li><span style="background-color:rgba(0,0,255,1)">G41</span></li>
</ul>
</div>
<canvas id="chart" width="960" height="645"></canvas>
<script>
var data = {
labels: ["QS", "CRL", "# of N's", "Percent of Phred scores above 20"],
datasets: [
{
label: "A42",
fillColor: "rgba(255,0,0,1)",
data: [46, 576, 43, 77],
},
{
label: "G42",
fillColor: "rgba(0,255,0,1)",
data: [38, 577, 45, 82],
},
{
label: "G41",
fillColor: "rgba(0,0,255,1)",
data: [0, 0, 0, 0],
}
]
};
var ctx = document.getElementById("chart").getContext("2d");
var chart = new Chart(ctx).Bar(data, {
barShowStroke: true
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment