<title>Polar Area Chart</title>
<script src="../dist/Chart.bundle.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+ <style>
+ canvas {
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ }
+ </style>
</head>
<body>
- <div id="canvas-holder" style="width:100%">
+ <div id="canvas-holder" style="width:75%">
<canvas id="chart-area"></canvas>
</div>
<button id="randomizeData">Randomize Data</button>
<button id="addData">Add Data</button>
<button id="removeData">Remove Data</button>
- <div>
- <h3>Legend</h3>
- <div id="legendContainer">
-
- </div>
- </div>
<script>
var randomScalingFactor = function() {
return Math.round(Math.random() * 100);
},
title: {
display: true,
- text: 'Our Favorite Dataset'
+ text: 'Chart.js Polar Area Chart'
},
scale: {
ticks: {
window.onload = function() {
var ctx = document.getElementById("chart-area");
window.myPolarArea = Chart.PolarArea(ctx, config);
- updateLegend();
};
- function updateLegend() {
- $legendContainer = $('#legendContainer');
- $legendContainer.empty();
- $legendContainer.append(window.myPolarArea.generateLegend());
- }
-
$('#randomizeData').click(function() {
$.each(config.data.datasets, function(i, piece) {
$.each(piece.data, function(j, value) {
});
});
window.myPolarArea.update();
- updateLegend();
});
$('#addData').click(function() {
});
window.myPolarArea.update();
- updateLegend();
}
});
});
window.myPolarArea.update();
- updateLegend();
});
</script>
</body>