Skip to content

Commit 9baa7b4

Browse files
committed
Fix for vaccinations graph (y-axis as off)
1 parent f501a8e commit 9baa7b4

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

index.html

+2
Original file line numberDiff line numberDiff line change
@@ -943,9 +943,11 @@ <h5 class="updated"><br /></h5>
943943
<div class="axis-chart"></div>
944944
<div class="axis-cover"></div>
945945
</div>
946+
<!--
946947
<div class="checkboxes">
947948
<div class="checkbox moving-average on"><div><div></div></div>Εμφάνιση κινούμενου μέσου όρου</div>
948949
</div>
950+
-->
949951
<p class="notes">Πηγή: <a href="https://emvolio.gov.gr/vaccinationtracker" target="_blank">emvolio.gov.gr</a>.</p>
950952
</div>
951953
</div>

index_en.html

+2
Original file line numberDiff line numberDiff line change
@@ -943,9 +943,11 @@ <h5 class="updated"><br /></h5>
943943
<div class="axis-chart"></div>
944944
<div class="axis-cover"></div>
945945
</div>
946+
<!--
946947
<div class="checkboxes">
947948
<div class="checkbox moving-average on"><div><div></div></div>Show Moving Average</div>
948949
</div>
950+
-->
949951
<p class="notes">Data Source: <a href="https://emvolio.gov.gr/vaccinationtracker" target="_blank">emvolio.gov.gr</a>.</p>
950952
</div>
951953
</div>

js/script.js

+40
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,46 @@ const init = () => {
895895
}
896896
};
897897

898+
//Fix for vaccinations y-axis not displaying proper values
899+
if(code == 'vaccinations'){
900+
hasMovingAverage = false;
901+
config.options.scales.xAxes= [
902+
{
903+
stacked: true,
904+
gridLines: {
905+
display: false,
906+
zeroLineColor: "rgba(255,255,0,0.7)"
907+
},
908+
ticks: {
909+
beginAtZero: disableBeginAtZero,
910+
fontColor: "rgba(255,255,255,0.7)",
911+
maxRotation: 0,
912+
minRotation: 0,
913+
callback: (label) => {
914+
return " " + label + " ";
915+
}
916+
}
917+
}];
918+
config.options.scales.yAxes= [{
919+
location: "bottom",
920+
stacked: true,
921+
gridLines: {
922+
display:true,
923+
zeroLineColor: "rgba(255,255,255,0.7)",
924+
borderDash: [3, 1],
925+
color: "rgba(255, 255, 255, 0.3)"
926+
},
927+
ticks: {
928+
fontColor: "transparent",
929+
userCallback: function(value, index, values) {
930+
value = value.toString();
931+
value = value.split(/(?=(?:...)*$)/);
932+
value = value.join(',');
933+
return value; },
934+
},
935+
}];
936+
}
937+
898938
if(code == 'predicted_true_inf'){
899939
config.options.scales.xAxes= [
900940
{

js/script.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)