mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add charts namespace and functions (#10169)
* Add charts namespace and functions * Fix missing function return implicit any
This commit is contained in:
parent
5b816099c3
commit
08b7b58fa3
@ -488,3 +488,25 @@ function test_formatter_PatternFormat() {
|
||||
|
||||
table.draw(view, { allowHtml: true, showRowNumber: true, width: '100%', height: '100%' });
|
||||
}
|
||||
|
||||
function test_ChartsLoad() {
|
||||
google.charts.load('current', {packages: ['corechart', 'table', 'sankey']});
|
||||
|
||||
function drawChart() {
|
||||
// Define the chart to be drawn.
|
||||
var data = new google.visualization.DataTable();
|
||||
data.addColumn('string', 'Element');
|
||||
data.addColumn('number', 'Percentage');
|
||||
data.addRows([
|
||||
['Nitrogen', 0.78],
|
||||
['Oxygen', 0.21],
|
||||
['Other', 0.01]
|
||||
]);
|
||||
|
||||
// Instantiate and draw the chart.
|
||||
var chart = new google.visualization.PieChart(document.getElementById('myPieChart'));
|
||||
chart.draw(data, null);
|
||||
}
|
||||
|
||||
google.charts.setOnLoadCallback(drawChart);
|
||||
}
|
||||
|
||||
@ -9,6 +9,12 @@ declare namespace google {
|
||||
function setOnLoadCallback(handler: Function): void;
|
||||
function setOnLoadCallback(handler: () => void): void;
|
||||
|
||||
// https://developers.google.com/chart/interactive/docs/basic_load_libs
|
||||
namespace charts {
|
||||
function load(version: string, packages: Object): void;
|
||||
function setOnLoadCallback(handler: Function): void;
|
||||
}
|
||||
|
||||
//https://developers.google.com/chart/interactive/docs/reference
|
||||
namespace visualization {
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user