Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufshakeel committed Jan 29, 2017
1 parent 286fb58 commit e324152
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
83 changes: 83 additions & 0 deletions js/pie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
$(document).ready(function () {

var ctx1 = $("#pie-chartcanvas-1");
var ctx2 = $("#pie-chartcanvas-2");

var data1 = {
labels : ["match1", "match2", "match3", "match4", "match5"],
datasets : [
{
label : "TeamA score",
data : [10, 50, 25, 70, 40],
backgroundColor : [
"#DEB887",
"#A9A9A9",
"#DC143C",
"#F4A460",
"#2E8B57"
],
borderColor : [
"#CDA776",
"#989898",
"#CB252B",
"#E39371",
"#1D7A46"
],
borderWidth : [1, 1, 1, 1, 1]
}
]
};

var data2 = {
labels : ["match1", "match2", "match3", "match4", "match5"],
datasets : [
{
label : "TeamB score",
data : [20, 35, 40, 60, 50],
backgroundColor : [
"#FAEBD7",
"#DCDCDC",
"#E9967A",
"#F5DEB3",
"#9ACD32"
],
borderColor : [
"#E9DAC6",
"#CBCBCB",
"#D88569",
"#E4CDA2",
"#89BC21"
],
borderWidth : [1, 1, 1, 1, 1]
}
]
};

var options = {
title : {
display : true,
position : "top",
text : "Pie Chart",
fontSize : 18,
fontColor : "#111"
},
legend : {
display : true,
position : "bottom"
}
};


var chart1 = new Chart( ctx1, {
type : "pie",
data : data1,
options : options
});

var chart2 = new Chart( ctx2, {
type : "pie",
data : data2,
options : options
});

});
28 changes: 28 additions & 0 deletions pie.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<title>ChartJS - Pie</title>

<link href="css/default.css" rel="stylesheet">

</head>
<body>

<div class="chart-container">
<div class="pie-chart-container">
<canvas id="pie-chartcanvas-1"></canvas>
</div>

<div class="pie-chart-container">
<canvas id="pie-chartcanvas-2"></canvas>
</div>
</div>

<!-- javascript -->
<script src="js/jquery.min.js"></script>
<script src="js/Chart.min.js"></script>

<script src="js/pie.js"></script>

</body>
</html>

0 comments on commit e324152

Please sign in to comment.