如何使用 TypeScript 和来自 github 的 Chartjs.definelyTyped 计算出 Chartjs
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29885809/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to work out Chartjs using TypeScript with Chartjs.definitelyTyped from github
提问by amcpanaligan
I want to use Chartjs(chartjs.org) as my charting tool along with AngularJS using TypeScript. I have installed DefinitelyTyped for Chartjs from GitHub to incorporate creation of Chartjs charts in my TypeScript written controller. I can't find any related questions on doing this thing.
我想使用 Chartjs(chartjs.org) 作为我的图表工具以及使用 TypeScript 的 AngularJS。我已经从 GitHub 为 Chartjs 安装了绝对类型化,以在我的 TypeScript 编写的控制器中合并 Chartjs 图表的创建。我找不到任何关于做这件事的相关问题。
I just need to know how we populate data to our charts using DefinitelyTyped.
我只需要知道我们如何使用绝对类型将数据填充到我们的图表中。
回答by basarat
You can find example usages of chart.d.ts
in the form of a tests file right next to the definition : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chart.js/chart.js-tests.ts
您可以chart.d.ts
在定义旁边以测试文件的形式找到示例用法:https: //github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chart.js/chart.js-tests.ts