Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix the description of tickInterval #13355

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/translations/api-docs/charts/axis-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"stroke": { "description": "The stroke color of the axis line." },
"tickFontSize": { "description": "The font size of the axis ticks text." },
"tickInterval": {
"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."
"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."
},
"tickLabelInterval": {
"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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"stroke": { "description": "The stroke color of the axis line." },
"tickFontSize": { "description": "The font size of the axis ticks text." },
"tickInterval": {
"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."
"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."
},
"tickLabelInterval": {
"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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"stroke": { "description": "The stroke color of the axis line." },
"tickFontSize": { "description": "The font size of the axis ticks text." },
"tickInterval": {
"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."
"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."
},
"tickLabelInterval": {
"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."
Expand Down
6 changes: 4 additions & 2 deletions packages/x-charts/src/ChartsXAxis/ChartsXAxis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ ChartsXAxis.propTypes = {
*/
tickFontSize: PropTypes.number,
/**
* Defines which ticks are displayed. Its value can be:
* Defines which ticks are displayed.
* Its value can be:
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
* - an array containing the values where ticks should be displayed.
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
* @default 'auto'
*/
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
Expand Down
6 changes: 4 additions & 2 deletions packages/x-charts/src/ChartsYAxis/ChartsYAxis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,12 @@ ChartsYAxis.propTypes = {
*/
tickFontSize: PropTypes.number,
/**
* Defines which ticks are displayed. Its value can be:
* Defines which ticks are displayed.
* Its value can be:
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
* - an array containing the values where ticks should be displayed.
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
* @default 'auto'
*/
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
Expand Down
6 changes: 4 additions & 2 deletions packages/x-charts/src/hooks/useTicks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ export interface TickParams {
*/
tickNumber?: number;
/**
* Defines which ticks are displayed. Its value can be:
* Defines which ticks are displayed.
* Its value can be:
* - 'auto' In such case the ticks are computed based on axis scale and other parameters.
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has a data property.
* - a filtering function of the form `(value, index) => boolean` which is available only if the axis has "point" scale.
* - an array containing the values where ticks should be displayed.
* @see See {@link https://mui.com/x/react-charts/axis/#fixed-tick-positions}
* @default 'auto'
*/
tickInterval?: 'auto' | ((value: any, index: number) => boolean) | any[];
Expand Down
Loading