Skip to content

Commit

Permalink
Change ChartAxisXOptions (DefinitelyTyped#11449)
Browse files Browse the repository at this point in the history
Change the type for minimum and maximum options in ChartAxisXOptions to
support both number and Date.
  • Loading branch information
fbeliveau78 authored and mhegazy committed Oct 4, 2016
1 parent 7f2cfbd commit debb379
Showing 1 changed file with 30 additions and 14 deletions.
44 changes: 30 additions & 14 deletions canvasjs/canvasjs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ declare namespace CanvasJS {
dataSeriesIndex: number;
}

interface ChartAxisXOptions {
interface ChartAxisOptions {
/**
* Sets the Axis Title.
* Default: null
Expand Down Expand Up @@ -472,18 +472,6 @@ declare namespace CanvasJS {
*/
valueFormatString?: string;
/**
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
minimum?: number;
/**
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
maximum?: number;
/**
* Sets the distance between Tick Marks, Grid Lines and Interlaced Colors.
* Default: Automatically Calculated
* Example: 50, 75..
Expand Down Expand Up @@ -638,13 +626,41 @@ declare namespace CanvasJS {
labelFontStyle?: string;
}

interface ChartAxisYOptions extends ChartAxisXOptions {
interface ChartAxisXOptions extends ChartAxisOptions {
/**
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
minimum?: number | Date;
/**
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
maximum?: number | Date;
}

interface ChartAxisYOptions extends ChartAxisOptions {
/**
* When includeZero is set to true, axisY sets the range in such a way that Zero is a part of it. It is set to true by default. But, whenever y values are very big and difference among dataPoints are hard to judge, setting includeZero to false makes axisY to set a range that makes the differences prominently visible.
* Default: true
* Example: true, false
*/
includeZero?: boolean;

/**
* Sets the minimum value of Axis. Values smaller than minimum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
minimum?: number;
/**
* Sets the maximum value permitted on Axis. Values greater than maximum are clipped.
* Default: Automatically Calculated based on the data
* Example: 100, 350..
*/
maximum?: number;
}

interface ChartToolTipOptions {
Expand Down

0 comments on commit debb379

Please sign in to comment.