Skip to content

Commit

Permalink
improve look
Browse files Browse the repository at this point in the history
  • Loading branch information
njuettner committed Jan 11, 2025
1 parent 2e5a110 commit 4532f93
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h1>Fed Data Collection</h1>
ctx.font = `${fontSize}px ${fontStyle}`;
ctx.fillStyle = fontColor;
ctx.textAlign = 'right';
ctx.fillText(label, chart.width - 10, 15);
ctx.fillText(label, chart.width - 10, 10);
ctx.restore();
}
};
Expand Down Expand Up @@ -297,6 +297,7 @@ <h1>Fed Data Collection</h1>
},
y: {
beginAtZero: true,
min: 0, // Ensure y-axis starts at 0
ticks: {
color: isDark ? '#ffffff' : '#333333'
},
Expand All @@ -315,7 +316,12 @@ <h1>Fed Data Collection</h1>
callbacks: {
title: function(context) {
const date = context[0].label;
return luxon.DateTime.fromISO(date).toFormat('dd MMM yyyy');
const dt = luxon.DateTime.fromISO(date);
if (dt.isValid) {
return dt.toFormat('dd MMM yyyy');
} else {
return date; // Fallback to original label if invalid
}
}
}
},
Expand Down

0 comments on commit 4532f93

Please sign in to comment.