diff --git a/web/src/app/test/page.tsx b/web/src/app/test/page.tsx
index 17810fb8d..e1a7704b1 100644
--- a/web/src/app/test/page.tsx
+++ b/web/src/app/test/page.tsx
@@ -25,9 +25,9 @@ export default function TestPage() {
>['plugins'] => {
let returnValue: DeepPartial>['plugins'] = {};
+ const titleColor = getComputedStyle(document.documentElement).getPropertyValue(
+ '--color-text-secondary'
+ );
+ const valueColor = getComputedStyle(document.documentElement).getPropertyValue(
+ '--color-text-default'
+ );
+
if (pieShowInnerLabel && pieDonutWidth !== 0) {
const annotation: AnnotationPluginOptions = {
annotations: {
@@ -61,8 +70,14 @@ export const piePluginsHandler = ({
)
];
},
- font: [{ size: 14 }, { size: 22 }],
- color: ['var(--color-text-tertiary)', 'var(--color-text-default)']
+ font: ({ chart }) => {
+ const minDimension = Math.min(chart.width, chart.height);
+ return [
+ { size: Math.max(20, minDimension * 0.02) }, // title font
+ { size: Math.max(42, minDimension * 0.042) } // value font
+ ];
+ },
+ color: [titleColor, valueColor]
}
}
};