diff --git a/highcharts/highcharts-modules-no-data-to-display-tests.ts b/highcharts/highcharts-modules-no-data-to-display-tests.ts new file mode 100644 index 0000000000..64b50f831f --- /dev/null +++ b/highcharts/highcharts-modules-no-data-to-display-tests.ts @@ -0,0 +1,10 @@ +/// +/// +/// + +function test_NoDataToDisplay() { + var chart = $("#container").highcharts(); + var chartHasData = chart.hasData(); + chart.hideNoData(); + chart.showNoData("Custom no data message"); +} diff --git a/highcharts/highcharts-modules-no-data-to-display.d.ts b/highcharts/highcharts-modules-no-data-to-display.d.ts new file mode 100644 index 0000000000..ab5fdd1d0d --- /dev/null +++ b/highcharts/highcharts-modules-no-data-to-display.d.ts @@ -0,0 +1,26 @@ +// Type definitions for Highcharts No Data to Display +// Project: http://www.highcharts.com/ +// Definitions by: Andrey Zolotin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +interface HighchartsChartObject { + /** + * Returns true if there are data points within the plot area now + * @return {boolean} If chart has any data. + * @since 3.0.8 + */ + hasData(): boolean; + + /** + * Hide the 'No data to display' message added by the no-data-to-display plugin. + * @since 3.0.8 + */ + hideNoData(): void; + + /** + * Display a no-data message. + * @param {String} message An optional message to show in place of the default one + * @since 3.0.8 + */ + showNoData(message?: string): void; +}