简体   繁体   English

简单的ChartJS离子示例-错误

[英]Simple ChartJS Ionic Example - Gone Wrong

I am trying to run a simple example of ionic with chartjs. 我正在尝试使用chartjs运行离子的简单示例。 Here is my Controller, I have added chart.js to my app.js, and the second is my graph.html page. 这是我的控制器,我已将chart.js添加到我的app.js中,第二个是我的graph.html页面。 I just get a blank white screen... 我只是得到一个空白的白屏...

var app = angular.module('app', ['ionic','ngCordova','chart.js']);
app.controller('graphCtrl', function ($scope) {
   $scope.labels = ["Book1", "Book2", "Book3"];
  $scope.data = [300, 500, 100];
});


<ion-view view-title="Outline">
<ion-content>
    <canvas id="radar" class="chart chart-radar"
            chart-data="data" chart-labels="labels">
    </canvas>
    </ion-content> 

</ion-view>

在此处输入图片说明

Have you seen the documentation for this? 您是否看到过此文档?

https://github.com/jtblin/angular-chart.js https://github.com/jtblin/angular-chart.js

Ionic is built upon angular, so angular-js plugins normally do work well with ionic. Ionic建立在angular之上,因此angular-js插件通常可以很好地与ionic配合使用。 U might been missing a few dependencies or wrong syntax. U可能缺少一些依赖项或语法错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM