Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: chart[chartType] is not a function at char.js 2.0 #7

Open
lorenzogm opened this issue Mar 2, 2016 · 7 comments
Open

Error: chart[chartType] is not a function at char.js 2.0 #7

lorenzogm opened this issue Mar 2, 2016 · 7 comments

Comments

@lorenzogm
Copy link

Hello, thank you very much to for sharing this directive, it's very useful. However I have the following issue:

I have included charts.js v2.0 and then the directive and I get this error

Error: chart[chartType] is not a function

Any idea why the function Chart.Line() (or whatever) is not defined?

@EvanBurbidge
Copy link

Also getting this problem.

@kcampion
Copy link

kcampion commented Aug 9, 2016

Same problem.

@Tatenda
Copy link

Tatenda commented Aug 9, 2016

Chart 2.1.3 is giving me same problem

@ghost
Copy link

ghost commented Aug 31, 2016

No fix yet?

@Davidpsj
Copy link

Davidpsj commented Feb 3, 2017

Hi!
This directive only work for chartjs v1, i.e, Chart.Line(), Chart.Bar() and etc is supported.
In second version of chartjs is different:

var ctx = document.getElementById('chartId').getContext('2d');
var chart = new Chart(ctx, optionsObj);

It's recomended if you dont want use version 1, update this directive using the new way.
In version one, you determine what chart type.
In new version, you pass in options object the type of chart.

To get more information, read the chatjs docs: http://www.chartjs.org/docs/#chart-configuration-creating-a-chart-with-options.

Regards!

@Xsmael
Copy link

Xsmael commented Feb 25, 2017

why don't you update your module ? instead of everyone updating for himself ?

or shall we make a fork of this ? software products has to keep updating...

@sertjerm
Copy link

Same problem

I found solution by
using CDN for Chart.js

<script src="http://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.1/Chart.min.js"></script>

instead chart.js v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants