Declare enum values where applicable (#29722)

This commit is contained in:
Daniel Luz 2018-10-15 13:28:27 -03:00 committed by Sheetal Nandi
parent f1827c5eff
commit f89eb54b58
2 changed files with 11 additions and 7 deletions

View File

@ -36,6 +36,7 @@ const chart: Chart = new Chart(new CanvasRenderingContext2D(), {
tooltips: {
filter: data => Number(data.yLabel) > 0,
intersect: true,
mode: 'index',
itemSort: (a, b) => Math.random() - 0.5,
position: "average",
caretPadding: 2,
@ -125,6 +126,7 @@ const chartConfig: Chart.ChartConfiguration = {
backgroundColor: '#37738353',
borderColor: '#37738353',
borderWidth: 3,
borderCapStyle: 'round',
fill: true
}]
},

View File

@ -174,6 +174,8 @@ declare namespace Chart {
type PositionType = 'left' | 'right' | 'top' | 'bottom';
type InteractionMode = 'point' | 'nearest' | 'single' | 'label' | 'index' | 'x-axis' | 'dataset' | 'x' | 'y';
interface ChartArea {
top: number;
right: number;
@ -185,10 +187,10 @@ declare namespace Chart {
text?: string;
fillStyle?: string;
hidden?: boolean;
lineCap?: string;
lineCap?: 'butt' | 'round' | 'square';
lineDash?: number[];
lineDashOffset?: number;
lineJoin?: string;
lineJoin?: 'bevel' | 'round' | 'miter';
lineWidth?: number;
strokeStyle?: string;
pointStyle?: PointStyle;
@ -331,7 +333,7 @@ declare namespace Chart {
interface ChartTooltipOptions {
enabled?: boolean;
custom?(a: any): void;
mode?: string;
mode?: InteractionMode;
intersect?: boolean;
backgroundColor?: ChartColor;
titleFontFamily?: string;
@ -373,7 +375,7 @@ declare namespace Chart {
type ChartTooltipPositioner = (elements: any[], eventPosition: Point) => Point;
interface ChartHoverOptions {
mode?: string;
mode?: InteractionMode;
animationDuration?: number;
intersect?: boolean;
onHover?(this: Chart, event: MouseEvent, activeElements: Array<{}>): any;
@ -541,10 +543,10 @@ declare namespace Chart {
backgroundColor?: ChartColor | ChartColor[];
borderWidth?: number | number[];
borderColor?: ChartColor | ChartColor[];
borderCapStyle?: string;
borderCapStyle?: 'butt' | 'round' | 'square';
borderDash?: number[];
borderDashOffset?: number;
borderJoinStyle?: string;
borderJoinStyle?: 'bevel' | 'round' | 'miter';
borderSkipped?: PositionType;
data?: number[] | ChartPoint[];
fill?: boolean | number | string;
@ -566,7 +568,7 @@ declare namespace Chart {
pointStyle?: PointStyle | HTMLImageElement | HTMLCanvasElement | Array<PointStyle | HTMLImageElement | HTMLCanvasElement>;
xAxisID?: string;
yAxisID?: string;
type?: string;
type?: ChartType | string;
hidden?: boolean;
hideInLegendAndTooltip?: boolean;
showLine?: boolean;