Skip to content

Commit c57f764

Browse files
[docs] Fix the description of tickInterval (#13355)
1 parent 6070f8e commit c57f764

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"stroke": { "description": "The stroke color of the axis line." },
3535
"tickFontSize": { "description": "The font size of the axis ticks text." },
3636
"tickInterval": {
37-
"description": "Defines which ticks are displayed. Its value can be:<br />- &#39;auto&#39; In such case the ticks are computed based on axis scale and other parameters.<br />- a filtering function of the form <code>(value, index) =&amp;gt; boolean</code> which is available only if the axis has a data property.<br />- an array containing the values where ticks should be displayed."
37+
"description": "Defines which ticks are displayed.<br />Its value can be:<br />- &#39;auto&#39; In such case the ticks are computed based on axis scale and other parameters.<br />- a filtering function of the form <code>(value, index) =&amp;gt; boolean</code> which is available only if the axis has &quot;point&quot; scale.<br />- an array containing the values where ticks should be displayed."
3838
},
3939
"tickLabelInterval": {
4040
"description": "Defines which ticks get its label displayed. Its value can be:<br />- &#39;auto&#39; In such case, labels are displayed if they do not overlap with the previous one.<br />- a filtering function of the form (value, index) =&gt; boolean. Warning: the index is tick index, not data ones."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"stroke": { "description": "The stroke color of the axis line." },
1818
"tickFontSize": { "description": "The font size of the axis ticks text." },
1919
"tickInterval": {
20-
"description": "Defines which ticks are displayed. Its value can be: - &#39;auto&#39; In such case the ticks are computed based on axis scale and other parameters. - a filtering function of the form <code>(value, index) =&gt; boolean</code> which is available only if the axis has a data property. - an array containing the values where ticks should be displayed."
20+
"description": "Defines which ticks are displayed. Its value can be: - &#39;auto&#39; In such case the ticks are computed based on axis scale and other parameters. - a filtering function of the form <code>(value, index) =&gt; boolean</code> which is available only if the axis has &quot;point&quot; scale. - an array containing the values where ticks should be displayed."
2121
},
2222
"tickLabelInterval": {
2323
"description": "Defines which ticks get its label displayed. Its value can be: - &#39;auto&#39; In such case, labels are displayed if they do not overlap with the previous one. - a filtering function of the form (value, index) =&gt; boolean. Warning: the index is tick index, not data ones."

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"stroke": { "description": "The stroke color of the axis line." },
1818
"tickFontSize": { "description": "The font size of the axis ticks text." },
1919
"tickInterval": {
20-
"description": "Defines which ticks are displayed. Its value can be: - &#39;auto&#39; In such case the ticks are computed based on axis scale and other parameters. - a filtering function of the form <code>(value, index) =&gt; boolean</code> which is available only if the axis has a data property. - an array containing the values where ticks should be displayed."
20+
"description": "Defines which ticks are displayed. Its value can be: - &#39;auto&#39; In such case the ticks are computed based on axis scale and other parameters. - a filtering function of the form <code>(value, index) =&gt; boolean</code> which is available only if the axis has &quot;point&quot; scale. - an array containing the values where ticks should be displayed."
2121
},
2222
"tickLabelInterval": {
2323
"description": "Defines which ticks get its label displayed. Its value can be: - &#39;auto&#39; In such case, labels are displayed if they do not overlap with the previous one. - a filtering function of the form (value, index) =&gt; boolean. Warning: the index is tick index, not data ones."

packages/x-charts/src/ChartsXAxis/ChartsXAxis.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,12 @@ ChartsXAxis.propTypes = {
315315
*/
316316
tickFontSize: PropTypes.number,
317317
/**
318-
* Defines which ticks are displayed. Its value can be:
318+
* Defines which ticks are displayed.
319+
* Its value can be:
319320
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
320-
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
321+
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
321322
* - an array containing the values where ticks should be displayed.
323+
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
322324
* @default 'auto'
323325
*/
324326
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),

packages/x-charts/src/ChartsYAxis/ChartsYAxis.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,12 @@ ChartsYAxis.propTypes = {
255255
*/
256256
tickFontSize: PropTypes.number,
257257
/**
258-
* Defines which ticks are displayed. Its value can be:
258+
* Defines which ticks are displayed.
259+
* Its value can be:
259260
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
260-
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
261+
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
261262
* - an array containing the values where ticks should be displayed.
263+
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
262264
* @default 'auto'
263265
*/
264266
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),

packages/x-charts/src/hooks/useTicks.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ export interface TickParams {
2121
*/
2222
tickNumber?: number;
2323
/**
24-
* Defines which ticks are displayed. Its value can be:
24+
* Defines which ticks are displayed.
25+
* Its value can be:
2526
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
26-
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
27+
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
2728
* - an array containing the values where ticks should be displayed.
29+
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
2830
* @default 'auto'
2931
*/
3032
tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[];

0 commit comments

Comments
 (0)