Skip to content

Instantly share code, notes, and snippets.

@chan24092005
Created March 3, 2018 11:54
Show Gist options
  • Save chan24092005/bb4be652cea1b1d1cb9e43895bf84990 to your computer and use it in GitHub Desktop.
Save chan24092005/bb4be652cea1b1d1cb9e43895bf84990 to your computer and use it in GitHub Desktop.
<style id="jsbin-css">
#containter {
display: flex;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js"></script>
<link href="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css" rel="stylesheet" type="text/css" /> <div id="containter">
<div id="canvas-holder" style="width:40%">
<canvas id="chart-area" />
</div>
<div id="canvas-holder-2" style="width:40%">
<canvas id="chart-area-2" />
</div>
</div>
<script id="jsbin-javascript">
var config = {
type: 'doughnut',
data: {
datasets: [{
data: [
1,
1,
1,
1,
1
],
label: 'Dataset 1'
}],
labels: [
"Red",
"Orange",
"Yellow",
"Green",
"Blue"
]
},
options: {
responsive: false,
legend: {
display: false
},
circumference:1 * Math.PI,
rotation: -1.5 * Math.PI
}
};
var ctx = document.getElementById("chart-area").getContext("2d");
window.myDoughnut = new Chart(ctx, config);
</script>
<script id="jsbin-source-html" type="text/html"><script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js"><\/script>
<link href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css" rel="stylesheet" type="text/css" /> <div id="containter">
<div id="canvas-holder" style="width:40%">
<canvas id="chart-area" />
</div>
<div id="canvas-holder-2" style="width:40%">
<canvas id="chart-area-2" />
</div>
</div>
</script>
<script id="jsbin-source-css" type="text/css">#containter {
display: flex;
}</script>
<script id="jsbin-source-javascript" type="text/javascript"> var config = {
type: 'doughnut',
data: {
datasets: [{
data: [
1,
1,
1,
1,
1
],
label: 'Dataset 1'
}],
labels: [
"Red",
"Orange",
"Yellow",
"Green",
"Blue"
]
},
options: {
responsive: false,
legend: {
display: false
},
circumference:1 * Math.PI,
rotation: -1.5 * Math.PI
}
};
var ctx = document.getElementById("chart-area").getContext("2d");
window.myDoughnut = new Chart(ctx, config);</script>
#containter {
display: flex;
}
var config = {
type: 'doughnut',
data: {
datasets: [{
data: [
1,
1,
1,
1,
1
],
label: 'Dataset 1'
}],
labels: [
"Red",
"Orange",
"Yellow",
"Green",
"Blue"
]
},
options: {
responsive: false,
legend: {
display: false
},
circumference:1 * Math.PI,
rotation: -1.5 * Math.PI
}
};
var ctx = document.getElementById("chart-area").getContext("2d");
window.myDoughnut = new Chart(ctx, config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment