Skip to content

Commit

Permalink
decrease Y axis font size on BarChart
Browse files Browse the repository at this point in the history
in an effort to give some more space to the chart itself
e-mission/e-mission-docs#961 (comment)
  • Loading branch information
JGreenlee committed Sep 7, 2023
1 parent 40a9b5e commit 96ee1c6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions www/js/components/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 96ee1c6

Please sign in to comment.