2👍
If you are using the Ionic Framework then you should also be using AngularJS. If that is so then you would need to include the dependency in your controller. I used ChartJS in my project very easily. Post your controller javascript code and I can help you setup. Take a look at this link first:
https://github.com/gonewandering/angles
You need to include the files in your index.html file first:
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.10/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1-beta.2/Chart.min.js"></script>
<script src="angles.js"></script>
Then include “angles” as a dependency:
var app = angular.module("anglesExample", ["angles"]);
Everything else appears to be okay.
Best of luck!
0👍
I suggest you to use another chart generator, something like:
This was built to work with angular…as Ionic was.
0👍
If you are using Chart.js, make sure you add the reference to your app.js
angular.module('yourapp', ['ionic', 'chart.js']);
Besides, you also need to include the following in your index.html, of course you have to make sure you are pointing to the correct directory where you put the 3 files below.
<!-- CSS file -->
<link rel="stylesheet" href="css/angular-chart.css">
<!-- Library files -->
<script src="angular.chart.min.js"></script>
<script src="Chart.js"></script>
0👍