Skip to content

Commit 8ec27cd

Browse files
Accept suggestion
1 parent 1021514 commit 8ec27cd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs/data/charts/bar-demo/RangeBarCandlestick.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const tooltipDollarFormatter = new Intl.NumberFormat(undefined, {
4646

4747
const min = dataset.reduce((acc, cur) => Math.min(acc, cur.low), Infinity);
4848
const max = dataset.reduce((acc, cur) => Math.max(acc, cur.high), -Infinity);
49+
const yDomain = niceDomain('linear', [min, max]);
4950

5051
const xAxis = [
5152
{
@@ -66,11 +67,7 @@ const yAxis = [
6667
{
6768
id: 'y',
6869
scaleType: 'linear',
69-
domainLimit: () => {
70-
const domain = niceDomain('linear', [min, max]);
71-
72-
return { min: domain[0].valueOf(), max: domain[1].valueOf() };
73-
},
70+
domainLimit: () => ({ min: yDomain[0], max: yDomain[1] }),
7471
valueFormatter: (value) => tickLabelDollarFormatter.format(value),
7572
},
7673
] satisfies YAxis[];

0 commit comments

Comments
 (0)