make chart text white
This commit is contained in:
parent
1becf92a26
commit
b2fe5751f1
@ -1,21 +1,21 @@
|
|||||||
<script>
|
<script>
|
||||||
import Chart from 'chart.js/auto'
|
import Chart from 'chart.js/auto';
|
||||||
import 'chartjs-adapter-luxon';
|
import 'chartjs-adapter-luxon';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import {getContext, onMount} from 'svelte'
|
import { getContext, onMount } from 'svelte';
|
||||||
import createPlayerService from '../../../services/scoresaber/player'
|
import createBeatSaviorService from '../../../services/beatsavior';
|
||||||
import createScoresService from '../../../services/scoresaber/scores'
|
import createPlayerService from '../../../services/scoresaber/player';
|
||||||
import createBeatSaviorService from '../../../services/beatsavior'
|
import createScoresService from '../../../services/scoresaber/scores';
|
||||||
import {formatNumber} from '../../../utils/format'
|
import eventBus from '../../../utils/broadcast-channel-pubsub';
|
||||||
import {
|
import {
|
||||||
dateFromString,
|
dateFromString,
|
||||||
formatDate,
|
formatDate,
|
||||||
formatDateWithOptions,
|
formatDateWithOptions,
|
||||||
toSsMidnight,
|
toSsMidnight,
|
||||||
} from '../../../utils/date'
|
} from '../../../utils/date';
|
||||||
import eventBus from '../../../utils/broadcast-channel-pubsub'
|
import { debounce } from '../../../utils/debounce';
|
||||||
import {debounce} from '../../../utils/debounce'
|
import { formatNumber } from '../../../utils/format';
|
||||||
import {onLegendClick} from './utils/legend-click-handler'
|
import { onLegendClick } from './utils/legend-click-handler';
|
||||||
|
|
||||||
export let playerId = null;
|
export let playerId = null;
|
||||||
export let rankHistory = null;
|
export let rankHistory = null;
|
||||||
@ -123,6 +123,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setupChart(hash, canvas) {
|
async function setupChart(hash, canvas) {
|
||||||
|
Chart.defaults.color = '#fff'; // Jank workaround to make the text white
|
||||||
if (!hash || !canvas || !rankHistory || !Object.keys(rankHistory).length || chartHash === lastHistoryHash) return;
|
if (!hash || !canvas || !rankHistory || !Object.keys(rankHistory).length || chartHash === lastHistoryHash) return;
|
||||||
|
|
||||||
lastHistoryHash = chartHash;
|
lastHistoryHash = chartHash;
|
||||||
@ -134,7 +135,7 @@
|
|||||||
const ppColor = "#007100";
|
const ppColor = "#007100";
|
||||||
const rankedPlayCountColor = "#3e3e3e";
|
const rankedPlayCountColor = "#3e3e3e";
|
||||||
const totalPlayCountColor = "#666";
|
const totalPlayCountColor = "#666";
|
||||||
const activityColor = "#333"
|
const activityColor = "#555"
|
||||||
|
|
||||||
const dtAccSaberToday = DateTime.fromJSDate(toSsMidnight(new Date()));
|
const dtAccSaberToday = DateTime.fromJSDate(toSsMidnight(new Date()));
|
||||||
const dayTimestamps = Array(CHART_DAYS).fill(0).map((_, idx) => toSsMidnight(dtAccSaberToday.minus({days: CHART_DAYS - 1 - idx}).toJSDate()).getTime());
|
const dayTimestamps = Array(CHART_DAYS).fill(0).map((_, idx) => toSsMidnight(dtAccSaberToday.minus({days: CHART_DAYS - 1 - idx}).toJSDate()).getTime());
|
||||||
|
Reference in New Issue
Block a user