update colors

This commit is contained in:
Nate Kelley 2025-04-01 17:11:07 -06:00
parent 3a7d1e59af
commit eb6936f598
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 22 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { ChartType, Chart, Plugin } from 'chart.js'; import { ChartType, Plugin } from 'chart.js';
export interface ChartHoverScatterPluginOptions { export interface ChartHoverScatterPluginOptions {
color?: string; color?: string;

View File

@ -1,7 +1,23 @@
'use client';
import { isServer } from '@tanstack/react-query';
const backgroundColor = isServer
? '#e6e6e6'
: getComputedStyle(document.documentElement).getPropertyValue('--color-background');
const borderColor = isServer
? '#e0e0e0'
: getComputedStyle(document.documentElement).getPropertyValue('--color-border');
const textColor = isServer
? '#575859'
: getComputedStyle(document.documentElement).getPropertyValue('--color-text-secondary');
export const defaultLabelOptionConfig = { export const defaultLabelOptionConfig = {
backgroundColor: 'var(--color-disabled)', backgroundColor: backgroundColor,
borderWidth: 0.5, borderWidth: 0.5,
borderColor: 'var(--color-border)', borderColor: borderColor,
borderRadius: 6, borderRadius: 6,
padding: { padding: {
top: 3, top: 3,
@ -9,7 +25,7 @@ export const defaultLabelOptionConfig = {
left: 6, left: 6,
right: 6 right: 6
}, },
color: 'var(--color-text-secondary)', color: textColor,
font: { font: {
size: 10, size: 10,
weight: 'normal' as const weight: 'normal' as const

View File

@ -29,6 +29,8 @@ export const barSeriesBuilder = ({
let hasBeenDrawn = false; let hasBeenDrawn = false;
console.log(hasBeenDrawn, defaultLabelOptionConfig);
dataLabelOptions.stackTotal = { dataLabelOptions.stackTotal = {
display: function (context) { display: function (context) {
const shownDatasets = context.chart.data.datasets.filter( const shownDatasets = context.chart.data.datasets.filter(