-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IDY2024 page including CYP and Yogathon. Index page: New manager and event count details updated
- Loading branch information
1 parent
8407e7c
commit b4569a3
Showing
9 changed files
with
1,562 additions
and
38 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Define a plugin to provide data labels | ||
Chart.plugins.register({ | ||
afterDatasetsDraw: function(chart, easing) { | ||
// To only draw at the end of animation, check for easing === 1 | ||
var ctx = chart.ctx; | ||
|
||
chart.data.datasets.forEach(function (dataset, i) { | ||
var meta = chart.getDatasetMeta(i); | ||
if (!meta.hidden) { | ||
meta.data.forEach(function(element, index) { | ||
// Draw the text in black, with the specified font | ||
ctx.fillStyle = 'rgb(0, 0, 0)'; | ||
|
||
var fontSize = 16; | ||
var fontStyle = 'normal'; | ||
var fontFamily = 'Helvetica Neue'; | ||
ctx.font = Chart.helpers.fontString(fontSize, fontStyle, fontFamily); | ||
|
||
// Just naively convert to string for now | ||
var dataString = dataset.data[index].toString(); | ||
|
||
// Make sure alignment settings are correct | ||
ctx.textAlign = 'center'; | ||
ctx.textBaseline = 'middle'; | ||
|
||
var padding = 5; | ||
var position = element.tooltipPosition(); | ||
ctx.fillText(dataString, position.x, position.y - (fontSize / 2) - padding); | ||
}); | ||
} | ||
}); | ||
} | ||
}); | ||
var ctx = document.getElementById("myChart").getContext('2d'); | ||
ctx.height = "200px"; | ||
var myChart = new Chart(ctx, { | ||
type: 'bar', | ||
data: { | ||
labels: [ "7-Jun", "10-Jun", "12-Jun", "14-Jun", "17-Jun", "19-Jun", "21-June 'IDY'"], | ||
datasets: [{ | ||
label: '# of Suryanamaskars', | ||
data: [12, 24, 48, 60, 72, 84, 108], | ||
backgroundColor: [ | ||
// 'rgba(255, 99, 132, 0.2)', | ||
'rgba(54, 162, 235, 0.2)', | ||
'rgba(255, 206, 86, 0.2)', | ||
'rgba(75, 192, 192, 0.2)', | ||
'rgba(153, 102, 255, 0.2)', | ||
'rgba(255, 159, 64, 0.2)', | ||
'rgba(255, 99, 132, 0.2)', | ||
'rgba(54, 162, 235, 0.2)', | ||
'rgba(255, 206, 86, 0.2)', | ||
'rgba(75, 192, 192, 0.2)', | ||
'rgba(153, 102, 255, 0.2)', | ||
'rgba(255, 159, 64, 0.2)', | ||
'rgba(75, 192, 192, 1.0)' | ||
], | ||
borderColor: [ | ||
// 'rgba(255,99,132,1)', | ||
'rgba(54, 162, 235, 1)', | ||
'rgba(255, 206, 86, 1)', | ||
'rgba(75, 192, 192, 1)', | ||
'rgba(153, 102, 255, 1)', | ||
'rgba(255, 159, 64, 1)', | ||
'rgba(255,99,132,1)', | ||
'rgba(54, 162, 235, 1)', | ||
'rgba(255, 206, 86, 1)', | ||
'rgba(75, 192, 192, 1)', | ||
'rgba(153, 102, 255, 1)', | ||
'rgba(255, 159, 64, 1)', | ||
'rgba(75, 192, 192, 1.0)' | ||
], | ||
borderWidth: 1 | ||
}] | ||
}, | ||
options: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero:true | ||
} | ||
}] | ||
} | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.