diff --git a/types/canvasjs/canvasjs-tests.ts b/types/canvasjs/canvasjs-tests.ts index dffa33e9a2..639e3ac043 100644 --- a/types/canvasjs/canvasjs-tests.ts +++ b/types/canvasjs/canvasjs-tests.ts @@ -17,6 +17,7 @@ let columnChart = new CanvasJS.Chart("chartContainer", data: [ { type: "column", + lineDashType:"longDash", showInLegend: true, legendMarkerColor: "grey", legendText: "MMbbl = one million barrels", diff --git a/types/canvasjs/index.d.ts b/types/canvasjs/index.d.ts index e079fdbe4b..2a9d04f9db 100644 --- a/types/canvasjs/index.d.ts +++ b/types/canvasjs/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: ShuYin Zhang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +type DashType = "solid" | "shortDash" | "shortDot" | "shortDashDot" | "shortDashDotDot" | "dot" | "dash" | "dashDot" | "longDash" | "longDashDot" | "longDashDotDot" + declare namespace CanvasJS { class Chart { /** @@ -693,20 +695,8 @@ declare namespace CanvasJS { /** * Sets the dash type for axisY. * Default: "solid" - * Supported Dash Types: - * “solid” - * “shortDash” - * “shortDot” - * “shortDashDot” - * “shortDashDotDot” - * “dot” - * “dash” - * “dashDot” - * “longDash” - * “longDashDot” - * “longDashDotDot” */ - lineDashType?: string; + lineDashType?: DashType; /** * Sets the minimum value of Axis. Values smaller than minimum are clipped. minimum also sets the lower limit while panning chart. * Default: Automatically Calculated based on the data. @@ -842,9 +832,8 @@ declare namespace CanvasJS { /** * Sets the Dash Type for stripLine. * Default: solid - * Example: “dot”, “dash”, etc. */ - lineDashType?: string; + lineDashType?: DashType; /** * Sets opacity of stripLine. * Default: null @@ -1044,9 +1033,8 @@ declare namespace CanvasJS { /** * Sets the Dash Type for grid lines on axisX. * Default: solid - * Options: “solid”, “shortDash”, “shortDot”, “shortDashDot”, “shortDashDotDot”, “dot”, “dash”, “dashDot”, “longDash”, “longDashDot”, “longDashDotDot” */ - gridDashType?: string; + gridDashType?: DashType; /** * A custom formatter function that returns label to be displayed on axisX. * Notes: @@ -1286,9 +1274,8 @@ declare namespace CanvasJS { * Sets the Dash Type for indexLabel’s line. It is applicable only for pie and doughnut charts when indexLabelPlacement is set to “outside”. * For other chart-types, indexLabelLineThickness should be set greater than zero. * Default: solid - * Example: “dot”, “dash”, etc. */ - indexLabelLineDashType?: string; + indexLabelLineDashType?: DashType; /** * A custom formatter function which returns the text to be displayed as indexLabel on dataPoints. * @param e event object @@ -1606,9 +1593,8 @@ declare namespace CanvasJS { /** * Sets the Line Dash Type for all Line and Area Charts. * Default: solid - * Example: “dot”, “dash”, etc. */ - lineDashType?: string; + lineDashType?: DashType; /** * Sets the Line Dash Type of line wherever null data is present. * Note: @@ -1616,20 +1602,8 @@ declare namespace CanvasJS { * 2.Supported with all Line and Area Charts. * 3.Not Supported on IE8. * Default: "dash" - * Supported Line Dash Types: - * “solid” - * “shortDash” - * “shortDot” - * “shortDashDot” - * “shortDashDotDot” - * "dot" - * “dash” - * “dashDot” - * “longDash” - * “longDashDot” - * “longDashDotDot” */ - nullDataLineDashType?: string; + nullDataLineDashType?: DashType; } interface ChartDataSeries extends ChartDataSeriesOptions {