Skip to content

Commit

Permalink
disable hourly chart since it got removed from free coingecko api :(
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfderechter committed Dec 28, 2024
1 parent f6823f3 commit d7db327
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ <h3>Total gain</h3>
<span>
<h2 class="totalValueTitle">Total value over time</h2>
<div id="toggleDate" class="toggleDate">
<button id="toggleDayMode" class="toggleDateModes" value="day" type="button">
<!-- <button id="toggleDayMode" class="toggleDateModes" value="day" type="button">
24H
</button>
</button> -->
<button id="toggleWeekMode" class="toggleDateModes" value="week" type="button">
7D
</button>
Expand Down
10 changes: 6 additions & 4 deletions src/charts/lineChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { isCacheValid } from "../data/cache";

// Constants
const DATE_MODES = {
DAY: { days: 1, interval: "hourly", arrayLength: 25 },
// Hourly chart has been disabled in the coingecko free api :(
// DAY: { days: 1, interval: "hourly", arrayLength: 25 },
WEEK: { days: 7, interval: "daily", arrayLength: 8 },
MONTH: { days: 31, interval: "daily", arrayLength: 32 },
YEAR: { days: 365, interval: "daily", arrayLength: 366 },
Expand Down Expand Up @@ -186,6 +187,7 @@ export async function prepareLineChart1() {
dateModeDays,
dateModeInterval
);

if (coinChart.length === 0) {
limited = true;
break;
Expand Down Expand Up @@ -252,14 +254,14 @@ let dateModeInterval = DATE_MODES.MONTH.interval;
let dateModeArrayLength = DATE_MODES.MONTH.arrayLength;

// Date Mode Switching
const toggleDayMode = document.getElementById("toggleDayMode")!;
// const toggleDayMode = document.getElementById("toggleDayMode")!;
const toggleWeekMode = document.getElementById("toggleWeekMode")!;
const toggleMonthMode = document.getElementById("toggleMonthMode")!;
const toggleYearMode = document.getElementById("toggleYearMode")!;
const toggleAllMode = document.getElementById("toggleAllMode")!;

[
toggleDayMode,
// toggleDayMode,
toggleWeekMode,
toggleMonthMode,
toggleYearMode,
Expand All @@ -275,7 +277,7 @@ function switchDateMode(e: Event) {

// Remove other active classes
[
toggleDayMode,
// toggleDayMode,
toggleWeekMode,
toggleMonthMode,
toggleYearMode,
Expand Down

0 comments on commit d7db327

Please sign in to comment.