From 96ee1c6db028a22745d90da73a6b21cf0be98372 Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Thu, 7 Sep 2023 01:50:58 -0400 Subject: [PATCH] decrease Y axis font size on BarChart in an effort to give some more space to the chart itself https://github.com/e-mission/e-mission-docs/issues/961#issuecomment-1708983132 --- www/js/components/BarChart.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/www/js/components/BarChart.tsx b/www/js/components/BarChart.tsx index 71dadb0c0..5cd100fad 100644 --- a/www/js/components/BarChart.tsx +++ b/www/js/components/BarChart.tsx @@ -49,15 +49,15 @@ const BarChart = ({ records, axisTitle, lineAnnotations, isHorizontal, timeAxis, if (!labelOptions) return { datasets: [] }; const modeColors = makeColorMap(chartDatasets, labelOptions); return { - datasets: chartDatasets.map((e, i) => ({ - ...e, - backgroundColor: (barCtx) => - meter ? getMeteredBackgroundColor(meter, barCtx, chartDatasets[i], colors) - : modeColors[chartDatasets[i]["label"]], - borderColor: (barCtx) => - meter ? getMeteredBackgroundColor(meter, barCtx, chartDatasets[i], colors, .25) - : modeColors[chartDatasets[i]["label"]], - })), + datasets: chartDatasets.map((e, i) => ({ + ...e, + backgroundColor: (barCtx) => + meter ? getMeteredBackgroundColor(meter, barCtx, chartDatasets[i], colors) + : modeColors[chartDatasets[i]["label"]], + borderColor: (barCtx) => + meter ? getMeteredBackgroundColor(meter, barCtx, chartDatasets[i], colors, .25) + : modeColors[chartDatasets[i]["label"]], + })), }; }, [chartDatasets, meter, labelOptions]); @@ -123,6 +123,7 @@ const BarChart = ({ records, axisTitle, lineAnnotations, isHorizontal, timeAxis, return label.split('\n'); return label; }, + font: { size: 11 }, // default is 12, we want a tad smaller }, reverse: true, stacked,