Skip to content

Commit 0beb2df

Browse files
[charts] Fix applyDomain docs (@JCQuintas) (#15333)
Co-authored-by: Jose C Quintas Jr <[email protected]>
1 parent 29da224 commit 0beb2df

File tree

10 files changed

+10
-14
lines changed

10 files changed

+10
-14
lines changed

docs/data/charts/axis/CustomDomainYAxis.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import TextField from '@mui/material/TextField';
55
import MenuItem from '@mui/material/MenuItem';
66

77
const settings = {
8-
valueFormatter: (v) => `${v}%`,
8+
valueFormatter: (value) => `${value}%`,
99
height: 200,
1010
showTooltip: true,
1111
showHighlight: true,
@@ -39,7 +39,6 @@ export default function CustomDomainYAxis() {
3939
<MenuItem value="strict">strict</MenuItem>
4040
<MenuItem value="function">function</MenuItem>
4141
</TextField>
42-
4342
<BarChart
4443
yAxis={[
4544
{

docs/data/charts/axis/CustomDomainYAxis.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import TextField from '@mui/material/TextField';
55
import MenuItem from '@mui/material/MenuItem';
66

77
const settings = {
8-
valueFormatter: (v: number | null) => `${v}%`,
8+
valueFormatter: (value: number | null) => `${value}%`,
99
height: 200,
1010
showTooltip: true,
1111
showHighlight: true,
@@ -43,7 +43,6 @@ export default function CustomDomainYAxis() {
4343
<MenuItem value="strict">strict</MenuItem>
4444
<MenuItem value="function">function</MenuItem>
4545
</TextField>
46-
4746
<BarChart
4847
yAxis={[
4948
{

docs/data/charts/axis/axis.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ xAxis={[
8686

8787
{{"demo": "MinMaxExample.js"}}
8888

89-
### Relative axis sub domain
89+
### Relative axis subdomain
9090

9191
You can adjust the axis range relatively to its data by using the `domainLimit` option.
9292
It can take 3 different values:

docs/data/charts/sparkline/CustomDomainYAxis.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Typography from '@mui/material/Typography';
88
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
99

1010
const settings = {
11-
valueFormatter: (v) => `${v}%`,
11+
valueFormatter: (value) => `${value}%`,
1212
height: 100,
1313
showTooltip: true,
1414
showHighlight: true,
@@ -66,7 +66,6 @@ export default function CustomDomainYAxis() {
6666
</TextField>
6767
<Typography>y-axis range: {yRange[domainLimitKey]}</Typography>
6868
</Stack>
69-
7069
<Stack
7170
sx={{
7271
width: '100%',

docs/data/charts/sparkline/CustomDomainYAxis.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Theme } from '@mui/material/styles';
88
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
99

1010
const settings = {
11-
valueFormatter: (v: number | null) => `${v}%`,
11+
valueFormatter: (value: number | null) => `${value}%`,
1212
height: 100,
1313
showTooltip: true,
1414
showHighlight: true,
@@ -70,7 +70,6 @@ export default function CustomDomainYAxis() {
7070
</TextField>
7171
<Typography>y-axis range: {yRange[domainLimitKey]}</Typography>
7272
</Stack>
73-
7473
<Stack
7574
sx={{
7675
width: '100%',

docs/data/charts/sparkline/CustomYAxis.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Typography from '@mui/material/Typography';
55
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
66

77
const settings = {
8-
valueFormatter: (v) => `${v}%`,
8+
valueFormatter: (value) => `${value}%`,
99
height: 100,
1010
showTooltip: true,
1111
showHighlight: true,

docs/data/charts/sparkline/CustomYAxis.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Typography from '@mui/material/Typography';
55
import { SparkLineChart } from '@mui/x-charts/SparkLineChart';
66

77
const settings = {
8-
valueFormatter: (v: number | null) => `${v}%`,
8+
valueFormatter: (value: number | null) => `${value}%`,
99
height: 100,
1010
showTooltip: true,
1111
showHighlight: true,

docs/data/charts/sparkline/sparkline.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The first row has the default y-axis values, while on the second row a fixed ran
6060
{{"demo": "CustomYAxis.js"}}
6161

6262
You can adjust the y-axis range of a sparkline relatively to its data by using the `domainLimit` option in the `yAxis` configuration.
63-
See the [axis docs page](http://localhost:3001/x/react-charts/axis/#relative-axis-sub-domain) form more information.
63+
See the [axis docs page](/x/react-charts/axis/#relative-axis-subdomain) for more information.
6464

6565
The demo below shows different ways to set the y-axis range.
6666
They always display the same data, going from -15 to 92, but with different `domainLimit` settings.

docs/translations/api-docs/charts/axis-config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"description": "The key used to retrieve <code>data</code> from the <code>dataset</code> prop."
1212
},
1313
"domainLimit": {
14-
"description": "Defines the axis scale domain based on the min/max values of series linked to it.<br />- &#39;nice&#39;: Rounds the domain at human friendly values.<br />- &#39;strict&#39;: Set the domain to the min/max value provided. No extras space is added.<br />- function: eceives the calculated extremums as parameters, and should return the axis domain."
14+
"description": "Defines the axis scale domain based on the min/max values of series linked to it.<br />- &#39;nice&#39;: Rounds the domain at human friendly values.<br />- &#39;strict&#39;: Set the domain to the min/max value provided. No extras space is added.<br />- function: Receives the calculated extremums as parameters, and should return the axis domain."
1515
},
1616
"hideTooltip": { "description": "If <code>true</code>, hide this value in the tooltip" },
1717
"max": {

packages/x-charts/src/models/axis.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export type AxisConfig<
337337
* Defines the axis scale domain based on the min/max values of series linked to it.
338338
* - 'nice': Rounds the domain at human friendly values.
339339
* - 'strict': Set the domain to the min/max value provided. No extras space is added.
340-
* - function: eceives the calculated extremums as parameters, and should return the axis domain.
340+
* - function: Receives the calculated extremums as parameters, and should return the axis domain.
341341
*/
342342
domainLimit?: 'nice' | 'strict' | ((min: number, max: number) => { min: number; max: number });
343343
} & Omit<Partial<AxisProps>, 'axisId'> &

0 commit comments

Comments
 (0)