diff --git a/types/chart.js/chart.js-tests.ts b/types/chart.js/chart.js-tests.ts index 46052d2303..27539c8d7d 100644 --- a/types/chart.js/chart.js-tests.ts +++ b/types/chart.js/chart.js-tests.ts @@ -47,6 +47,7 @@ const chart: Chart = new Chart(ctx, { displayColors: true, borderColor: "rgba(0,0,0,0)", borderWidth: 1, + titleAlign: 'center', callbacks: { title: ([point]) => point.label ? point.label.substring(0, 2) : 'title', label(tooltipItem) { diff --git a/types/chart.js/index.d.ts b/types/chart.js/index.d.ts index 6eb33aaca7..498f406701 100644 --- a/types/chart.js/index.d.ts +++ b/types/chart.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Chart.js 2.7 +// Type definitions for Chart.js 2.8 // Project: https://github.com/nnnick/Chart.js, https://www.chartjs.org // Definitions by: Alberto Nuti // Fabien Lavocat @@ -133,6 +133,8 @@ declare namespace Chart { 'easeInOutSine' | 'easeInExpo' | 'easeOutExpo' | 'easeInOutExpo' | 'easeInCirc' | 'easeOutCirc' | 'easeInOutCirc' | 'easeInElastic' | 'easeOutElastic' | 'easeInOutElastic' | 'easeInBack' | 'easeOutBack' | 'easeInOutBack' | 'easeInBounce' | 'easeOutBounce' | 'easeInOutBounce'; + type TextAlignment = 'left' | 'center' | 'right'; + interface ChartArea { top: number; right: number; @@ -296,17 +298,20 @@ declare namespace Chart { mode?: InteractionMode; intersect?: boolean; backgroundColor?: ChartColor; + titleAlign?: TextAlignment; titleFontFamily?: string; titleFontSize?: number; titleFontStyle?: string; titleFontColor?: ChartColor; titleSpacing?: number; titleMarginBottom?: number; + bodyAlign?: TextAlignment; bodyFontFamily?: string; bodyFontSize?: number; bodyFontStyle?: string; bodyFontColor?: ChartColor; bodySpacing?: number; + footerAlign?: TextAlignment; footerFontFamily?: string; footerFontSize?: number; footerFontStyle?: string;