Merge pull request #10580 from nitoloz/feature/10342

#10342 Added hideNoData/showNoData methods to highcharts
This commit is contained in:
Nathan Shively-Sanders
2016-08-12 09:48:19 -07:00
committed by GitHub
2 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
/// <reference path="highcharts-modules-no-data-to-display.d.ts" />
/// <reference path="highcharts.d.ts" />
/// <reference path="../jquery/jquery.d.ts" />
function test_NoDataToDisplay() {
var chart = $("#container").highcharts();
var chartHasData = chart.hasData();
chart.hideNoData();
chart.showNoData("Custom no data message");
}

View File

@@ -0,0 +1,26 @@
// Type definitions for Highcharts No Data to Display
// Project: http://www.highcharts.com/
// Definitions by: Andrey Zolotin <http://github.com/nitoloz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="highcharts.d.ts" />
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;
}