Skip to content

Commit

Permalink
fix(types): Fix the type declarations for the y tick format
Browse files Browse the repository at this point in the history
- fix axis.y.tick.format definition
- add missing axis.y.type definition

Close naver#2790
  • Loading branch information
stof authored and netil committed Jul 26, 2022
1 parent 3e25e90 commit 1d378e0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions types/axis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,21 @@ export interface yAxisConfiguration extends yAxisConfigurationBase {
* Set clip-path attribute for y axis element.
*/
clipPath?: boolean;

/**
* Set type of y axis.<br><br>
* **Available Values:**
* - indexed
* - log
* - timeseries
*
* **NOTE:**
* - **log** type:
* - the bound data values must be exclusively-positive.
* - y axis min value should be >= 0.
* - `data.groups`(stacked data) option aren't supported.
*/
type?: "indexed" | "log" | "timeseries";
}

export interface XTickConfiguration {
Expand Down Expand Up @@ -305,7 +320,7 @@ export interface XTickConfiguration {
* - axis min value should be >= 0.
* - `data.groups`(stacked data) option aren't supported.
*/
type?: "indexed" | "log" | "timeseries";
type?: "category" | "indexed" | "log" | "timeseries";
}

export interface YTickConfiguration {
Expand Down Expand Up @@ -337,7 +352,7 @@ export interface YTickConfiguration {
* Set formatter for y axis tick text.
* This option accepts d3.format object as well as a function you define.
*/
format?(this: Chart, x: number | Date): string | number;
format?: (this: Chart, x: number | Date) => string | number;

/**
* Setting for culling ticks.
Expand Down

0 comments on commit 1d378e0

Please sign in to comment.