Skip to content

Commit 7c71ed4

Browse files
authored
fix: Do not render cursors if disabled (#290)
* Fixed typo from docs * Do not show cursors at all if disabled
1 parent a08e7c9 commit 7c71ed4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/src/pages/docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ If you'd like to have a custom height and width in the client side you may have
135135

136136
`getSeriesOrder` expect a function, this option will allows you to reorder the series if you want.
137137

138-
`primaryCursor` and `secundaryCursor` take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.
138+
`primaryCursor` and `secondaryCursor` take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.
139139

140140
## Axes
141141

@@ -306,7 +306,7 @@ const secondaryAxes = React.useMemo(
306306

307307
**getSeriesOrder** expect a function, this option will allows you to reorder the series if you want.
308308

309-
**primaryCursor** and **secundaryCursor** take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.
309+
**primaryCursor** and **secondaryCursor** take the options that configure the line/rectangle that is drawn underneath your cursor when you hover over the chart. When both are used, it produces a kind of cross-hair. Both are set to true by default.
310310

311311
### Curve Types
312312

src/components/Cursors.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ export default function Cursors<TDatum>() {
6969

7070
return (
7171
<>
72-
<Cursor primary options={resolvedPrimaryOptions} />
73-
<Cursor options={resolvedSecondaryOptions} />
72+
{resolvedPrimaryOptions.show && <Cursor primary options={resolvedPrimaryOptions} />}
73+
{resolvedSecondaryOptions.show && <Cursor options={resolvedSecondaryOptions} />}
7474
</>
7575
)
7676
}

0 commit comments

Comments
 (0)