From c70c8fdaf2956571a9b58f011a247b919005490d Mon Sep 17 00:00:00 2001 From: Marshall Polaris Date: Tue, 27 Sep 2022 16:15:47 -0700 Subject: [PATCH] Adjust x-axis tick count --- web/components/charts/generic-charts.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/components/charts/generic-charts.tsx b/web/components/charts/generic-charts.tsx index 34010a24..7f573e3a 100644 --- a/web/components/charts/generic-charts.tsx +++ b/web/components/charts/generic-charts.tsx @@ -122,7 +122,7 @@ export const SingleValueDistributionChart = (props: { const { fmtX, fmtY, xAxis, yAxis } = useMemo(() => { const fmtX = (n: number) => formatLargeNumber(n) const fmtY = (n: number) => formatPct(n, 2) - const xAxis = axisBottom(xScale).tickFormat(fmtX) + const xAxis = axisBottom(xScale).ticks(w / 100) const yAxis = axisLeft(yScale).tickFormat(fmtY) return { fmtX, fmtY, xAxis, yAxis } }, [xScale, yScale]) @@ -210,7 +210,7 @@ export const MultiValueHistoryChart = (props: { const [min, max] = yScale.domain() const pctTickValues = getTickValues(min, max, h < 200 ? 3 : 5) - const xAxis = axisBottom(xScale) + const xAxis = axisBottom(xScale).ticks(w / 100) const yAxis = pct ? axisLeft(yScale).tickValues(pctTickValues).tickFormat(fmtY) : axisLeft(yScale) @@ -322,7 +322,7 @@ export const SingleValueHistoryChart = (props: { const [min, max] = yScale.domain() const pctTickValues = getTickValues(min, max, h < 200 ? 3 : 5) - const xAxis = axisBottom(xScale) + const xAxis = axisBottom(xScale).ticks(w / 100) const yAxis = pct ? axisLeft(yScale).tickValues(pctTickValues).tickFormat(fmtY) : axisLeft(yScale)