| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /*=========================================================================================
- File Name: doughnut.js
- Description: Chartjs simple doughnut chart
- ----------------------------------------------------------------------------------------
- Item Name: Robust - Responsive Admin Theme
- Version: 1.2
- Author: PIXINVENT
- Author URL: http://www.themeforest.net/user/pixinvent
- ==========================================================================================*/
- // Doughnut chart
- // ------------------------------
- $(window).on("load", function(){
- //Get the context of the Chart canvas element we want to select
- var ctx = $("#doughnut-chart");
- // Chart Options
- var chartOptions = {
- responsive: true,
- maintainAspectRatio: false,
- responsiveAnimationDuration:500,
- };
- // Chart Data
- var chartData = {
- labels: ["January", "February", "March", "April", "May"],
- datasets: [{
- label: "My First dataset",
- data: [65, 59, 80, 81, 56],
- backgroundColor: ["#99B898","#FECEA8","#FF847C","#E84A5F","#2A363B"],
- }, {
- label: "My Second dataset",
- data: [28, 48, 40, 19, 86],
- backgroundColor: ["#99B898","#FECEA8","#FF847C","#E84A5F","#2A363B"],
- }, {
- label: "My Third dataset - No bezier",
- data: [45, 25, 16, 36, 67],
- backgroundColor: ["#99B898","#FECEA8","#FF847C","#E84A5F","#2A363B"],
- }, {
- label: "My Fourth dataset",
- data: [17, 62, 78, 88, 26],
- backgroundColor: ["#99B898","#FECEA8","#FF847C","#E84A5F","#2A363B"],
- }]
- };
- var config = {
- type: 'doughnut',
- // Chart Options
- options : chartOptions,
- data : chartData
- };
- // Create the chart
- var doughnutChart = new Chart(ctx, config);
- });
|