Skip to content

Commit

Permalink
docs: update constants
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed May 12, 2021
1 parent 97be511 commit 6ab1af6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/api/constants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Constants

There are some constants for tickInterval option used in time scale.

## Usage

<a name="DURATION_SECOND" href="#DURATION_SECOND">#</a> **DURATION_SECOND**

```ts
import { Time, DURATION_SECOND } from '@antv/scale';

DURATION_SECOND; // 60000

const x = new Time({
tickInterval: DURATION_SECOND
domain: [new Date(2011, 0, 1, 12, 0, 0), new Date(2011, 0, 1, 12, 0, 4)]
})
x.getTicks();
//[new Date(2011, 0, 1, 12, 0, 0),
// new Date(2011, 0, 1, 12, 0, 1),
// new Date(2011, 0, 1, 12, 0, 2),
// new Date(2011, 0, 1, 12, 0, 3),
// new Date(2011, 0, 1, 12, 0, 4),]
```

0 comments on commit 6ab1af6

Please sign in to comment.